{
  "data_dir": "/media/vector",
  "sources": {
    "syslog": {
      "type": "syslog",
      "address": "0.0.0.0:514",
      "mode": "tcp",
      "host_key": "vector_remote"
    },
    "journal": {
      "type": "journald"
    },
    "host": {
      "type": "host_metrics"
    },
    "packetbeat": {
      "type": "exec",
      "command": [
        "packetbeat",
        "-e",
        "-c",
        "/etc/packetbeat.yml"
      ],
      "mode": "streaming",
      "include_stderr": true
    }
  },
  "transforms": {
    "host_metrics_to_logs": {
      "type": "metric_to_log",
      "inputs": [
        "host"
      ]
    },
    "packetbeat_unpacked": {
      "type": "remap",
      "inputs": [
        "packetbeat"
      ],
      "source": ".message = parse_json!(.message)"
    },
    "add_vector_invocation_id": {
      "type": "remap",
      "inputs": [
        "journal",
        "packetbeat_unpacked",
        "host_metrics_to_logs",
        "syslog"
      ],
      "source":  ".vector_invocation =  to_string(get_env_var!(\"INVOCATION_ID\")) ;  .vector_invocation_ts, _ =  to_string(get_env_var!(\"INVOCATION_ID\"))  + \":\" + to_string(.timestamp); .timestamp = now()"
    }
  },
  "sinks": {
    "my_sink_id": {
      "type": "file",
      "inputs": [
        "add_vector_invocation_id"
      ],
      "compression": "gzip",
      "encoding": {
        "codec": "json"
      },
      "path": "/var/log/vector-{{ vector_invocation }}-%F-%H-%M.log.gz"
    }
  }
}
