openstack-ansible-ops/elk_metrics_6x/templates/99-elasticsearch-output.conf.j2
Kevin Carter a1887b5cc9 Correct community beats index
Community beats sometimes lack all of the assumed metadata that a core
beat would contain by default. This change will check if a beat has the
version metadata before assuming it does, which is commonly not found on
community beats (journalbeat).

Change-Id: I64adf5ff7c810a593b9fc2d0f306cfd4bda6632d
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-06-15 18:15:21 -05:00

18 lines
644 B
Django/Jinja

output {
if [@metadata][version] {
elasticsearch {
hosts => {{ elasticsearch_data_hosts | shuffle(seed=inventory_hostname) | to_json }}
sniffing => {{ (not data_node | bool) | lower }}
manage_template => {{ (data_node | bool) | lower }}
index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"
}
} else {
elasticsearch {
hosts => {{ elasticsearch_data_hosts | shuffle(seed=inventory_hostname) | to_json }}
sniffing => {{ (not data_node | bool) | lower }}
manage_template => {{ (data_node | bool) | lower }}
index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
}
}
}