Skip to content

ES template creation does not respect custom index names #411

Open
@iserko

Description

@iserko

I'm using an ES server with multiple Logstash indexers and for each one I'm using it's own ES index prefix. Here's an example config for one:

output {
    elasticsearch {
        hosts => ["esserver:9200"]
        index => "example-logstash-%{+YYYY.MM.dd}"
        template_name => "example-logstash"
    }
}

When I check the index template created for this I see:

% curl -XGET http://esserver:9200/_template/ | json_pp
{
   "example-logstash" : {
      "template" : "logstash-*",
      "order" : 0,
      "aliases" : {},
      "settings" : {
         "index" : {
            "refresh_interval" : "5s"
         }
      },
      "mappings" : {
      ...
}

The problem is that the template setting is set to logstash-* which will never match the indexes example-logstash-* upon index creation. See https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html for more examples.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions