-
Hi all. We use Papertrail as our logging database. I'm trying to run Vector as an agent in our Nomad cluster. I've got the following config: data_dir = "alloc/data/"
[api]
enabled = false
[sources.journald]
type = "journald"
current_boot_only = true
since_now = true
include_units = []
# Warning and above
include_matches.PRIORITY = [ "0", "1", "2", "3", "4" ]
[sources.docker]
type = "docker_logs"
[transforms.nomad_tasks]
type = "remap"
inputs = ["docker"]
source = """
# We require all Docker contains to have labels for at least the Nomad task group and
# task itself. These form the 'process' field in Papertrail.
.process, err = .label."com.hashicorp.nomad.task_group_name" + "-" + .label."com.hashicorp.nomad.task_name"
if err != null {
abort "Missing required Nomad labels: " + string!(err)
}
# Remap the host to be the hostname of the Nomad client (the default is the hostname
# of this Vector agent's container, which is fairly useless)
.host = "[[env "attr.unique.hostname"]]"
"""
[sinks.papertrail]
type = "papertrail"
inputs = [ "journald", "nomad_tasks" ]
encoding.codec = "raw_message"
endpoint = "logsXXX.papertrailapp.com:XXX"
[sinks.console]
type = "console"
inputs = ["nomad_tasks"]
encoding.only_fields = ["message", "host", "process"]
encoding.codec = "json" This agent runs and produces
This is exactly what I want. The problem is, the corresponding Papertrail events all get attributed to |
Beta Was this translation helpful? Give feedback.
Answered by
ocharles
Jun 16, 2025
Replies: 1 comment
-
Problem solved! I needed to add the [sinks.papertrail]
process = "{{.process}}"
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ocharles
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem solved! I needed to add the
process
option to my sink: