Using environment variables on filebeat config file

I'd like to tag the logs coming from filebeat with the content of an environment variable, but I need to remove dashes from the environment variable. I've tried this

  tags: ["agent", ${APPLICATION_NAME//-/}]

but even though it works in bash, it doesn't work in filebeat.

Can this be done?

Hi @fiunchinho,

Beats don't use the same semantics as Bash. We don't support these kind of transformations to env variables, I would recommend setting the transformed env variable outside Filebeat, before launching it

Ok, thank you

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