I was hopping to use an env variable as part of the index name:
...
output.elasticsearch:
...
index: 'auditbeat-${ENVIRONMENT_NAME}-%{[host][name]}-%{+yyyy.MM.dd}'
...
But when setting up the Kibana dashboard manually I get:
Exiting: missing field accessing 'output.elasticsearch.index' (source:'auditbeat.yml')
What worked for me is adding the env variable as a field and then use it in the index name:
...
fields:
environment_name: ${ENVIRONMENT_NAME}
...
output.elasticsearch:
...
index: 'auditbeat-%{[fields][environment_name]}-%{[host][name]}-%{+yyyy.MM.dd}'
...
But I'm not interested to store the [fields][environment_name]
field in ES, is there a work around to achieve this perhaps with storing a temp variable in @metadata
field?