Metricbeat add fields in index elasticsearch


I am using Metricbeat and I want to name each Elasticsearch index specifically so I tried this:
elasticsearch {
hosts => [ "" ]
index => "idx-metricbeat-%{fields.meta_app}-%{+YYYY.MM.dd}"
flush_size => 100
idle_flush_time => 1
template => "/etc/logstash/templates.d/metricbeat.template.json"
template_name => "metricbeat"
template_overwrite => true
document_type => "logs"

Where "meta_app" is part of metricbeat logs:
"fields" => {
"meta_env" => "pp",
"meta_app" => "plm",
"meta_com" => "system",

But for now, Logstash is not able to name correctly the elasticsearch index, here is the index generated:

Thanks for your help.


Seems to be Logstash, not beats.

The format string syntax for accessing fields requires you to use [] to access fields...

this should help:

index => "idx-metricbeat-%{[fields][meta_app]}-%{+YYYY.MM.dd}"

it's working!
Thanks a lot

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