Custom elasticsearch template

I'm trying to load a custom elasticsearch template when filebeat starts up. The relevant part of my latest filebeat.yml looks like:

  enabled: true
  hosts: ["<%= @elasticsearch %>:443"]
  protocol: "https"
  index: "audit-%{+yyyyMMdd}"

  name: 'audit'
  pattern: 'audit-*'
    enabled: true
    path: 'audit.template.json'
    name: 'audit'
  enabled: true
    index.number_of_shards: 3

But a default mapping is applied to the index and no template is defined. The docs say the setup.template.json.* options are experimental, so not sure if they do indeed work.

Regardless, how can I load a json template defined in audit.template.json? I've tried every option combination based on reading the docs and can't get it to work.


Assuming that the template has the structure expected by the _template API, you can simply upload your template with curl or the Kibana console.

See the metricbeat documentation on how to export templates from metricbeat.

Thanks. Yes, I'm able to install the template manually, but just hoping to have filebeat do it. I'm doing all of this in chef, so I just added some curl goodness to do it that way.

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