I’m shipping logs from on-premise to the GCP using google-fluentd agent but on the GCP side it has missing few metadata like resource.labels.instance_id
Is there any way to have it set via fluentd configuration? I saw some solutions for kubernetes but none for logs from VMs.
Fluentd config looks like:
<source>
@type tail
path /var/log/my-app/*
pos_file /var/lib/google-fluentd/pos/my-app.tail.log.pos
tag test.tail-logs
format /^(?<time>\d{4}-\d{1,2}-\d{1,2} \d{1,2}:\d{1,2}:\d{1,2},\d{3}) (?<severity>[^\s]+) (?<message>.*)/
time_format %F %T,%L
</source>
<match my-app.**>
@type record_reformer
tag ${tag_suffix[1]}
</match>
<filter test.*>
@type record_transformer
<record>
instance_id "#{Socket.gethostname}"
</record>
</filter>