How do I add AWS metadata to Filebeat?

(Apoorv Parijat) #1

I want to include AWS Instance's tag information in each Filebeat document. I can think of two ways to do this -

  1. Modify the log output and include the info in there. This will require tweaking all the services whose log files are being tracked.
  2. Run a script at launch that
  • modifies the filebeat.yml file
  • pulls AWS metadata for that instance
  • and adds the tag info to yml file

It sounds like method 2 is the right approach.
Is there a better way to do this? Does Filebeat provide a way to dynamically set prospector attributes?

(Maddin2016) #2

You can also use environment variables. See here for more infos.

(Andrew Kroh) #3

You just need to add this to your config file if you want instance_id. For other information you could use environment variables.

- add_cloud_metadata:

See the add_cloud_metadata documentation for more details.

(Apoorv Parijat) #4

Thanks. This helps.

(system) #5

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.