Filebeat: Template Creation Error

Hi,
I'm testing filebeat 6.7.1 and am testing creation of custom template and index names. My config looks like this:

setup.template:
  enabled: true
  name: "beats-logs-%{[agent.version]}"
  pattern: "beats-logs-*"
  fields: "/etc/filebeat/fields.yml"
  overwrite: false
  settings:
    index.number_of_shards: 3
    index.number_of_replicas: 1
    index.codec: best_compression
    _source.enabled: false
setup.kibana:
output.elasticsearch:
  hosts: ["localhost:9200"]
  index: "beats-logs-%{[agent.version]}-%{+yyyy.MM.dd}"

Filebeat starts but throws the following error:

019-04-17T07:15:51.183Z        ERROR   pipeline/output.go:100  Failed to connect to backoff(elasticsearch(http://localhost:9200)): Connection marked as failed because the onConnect callback failed: Error loading Elasticsearch template: error creating template instance: key not found
2019-04-17T07:15:51.183Z        INFO    pipeline/output.go:93   Attempting to reconnect to backoff(elasticsearch(http://localhost:9200)) with 3 reconnect attempt(s)

What am I doing wrong here?

Regards,
D

This is supported starting 7.0.0. For 6.x, use %{[beat.version]} instead.

1 Like

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