Index template not getting applied to my index

Hi Community,

I have created a new index template( for total_field_limit) using Kibana console, but it is not getting applied with my index. I have deleted my index and then ran the code so that the index will pick the template but its not. Please help

Please share the template and the command you use to create the index. It is also always useful to specify which version of Elasticsearch you are using.

Hi Christian

Elasticsearch version: 8+

Below is the template, i used Kibana console to create template

{
  "template": {
    "settings": {
      "index": {
        "routing": {
          "allocation": {
            "include": {
              "_tier_preference": "data_content"
            }
          }
        },
        "mapping": {
          "total_fields": {
            "limit": "15000"
          }
        }
      }
    },
    "mappings": {
      "dynamic_templates": []
    },
    "aliases": {}
  }
}

and index creation

elasticsearch {
            hosts => ["${ES_NODE}"]
            validate_after_inactivity => 0
            resurrect_delay => 300
            index => "logstash-mcmc-combined-%{+YYYY-MM}"
            action => "update"
            document_id => "%{session_id}"
            doc_as_upsert => true
            user => "${ES_USER_NAME}"
            password => "${ES_USER_PASSWORD}"
            ssl_enabled =>  true
            ssl_verification_mode => "${SSL_VERIF_MODE}"
            ssl_certificate_authorities => "xxx"
            ssl_key => "xxx"
            ssl_certificate => "xxxx"
         }

Note: I am new to ELK

You did not specify any index pattern the template should apply to. Have a look at the examples in the docs.

I did, look at the below screen shot

index eg:logstash-mcmc-combined-2023-06

There is nothing in the template you posted. I do not use Kibana to manage index templates so am not sure what that screenshot shows.

It shows the Index pattern in the template created

I got it now, there was another template having more priority which is why my template is not picked. Thanks chris

2 Likes