Creating custom elasticsearch index with logstash
<p>I have to create custom index in elasticsearch using logstash. I have created new template in elasticsearch, and in logstash configuration i have specify template path,template_name and template_overwrite value,but still whenever I run logstash, new index is generated with logstash-dd-mm-yy regex,not with template_name specified in properties, 
logstash -config file is </p>

<pre><code>input {
  file {
    path =&gt; "/temp/file.txt"
    type =&gt; "words"
    start_position =&gt; "beginning"    
  }
}  
filter {

   mutate {
    add_field =&gt; {"words" =&gt; "%{message}"}
  }

}
output {
    elasticsearch {
     hosts =&gt; ["elasticserver:9200"]
     template =&gt; "pathtotemplate.json"
     template_name =&gt; "newIndexName-*"
     template_overwrite =&gt; true
    }
    stdout{}
}
</code></pre>

<p>Index template file is </p>

<pre><code>{
    "template": "dictinary-*",
    "settings" : {
        "number_of_shards" : 1,
        "number_of_replicas" : 0,
        "index" : {
            "query" : { "default_field" : "@words" },
            "store" : { "compress" : { "stored" : true, "tv": true } }
        }
    },
    "mappings": {
        "_default_": { 
            "_all": { "enabled": false },
            "_source": { "compress": true },
            "dynamic_templates": [
                {
                    "string_template" : { 
                        "match" : "*",
                        "mapping": { "type": "string", "index": "not_analyzed" },
                        "match_mapping_type" : "string"
                     } 
                 }
             ],
             "properties" : {
                "@fields": { "type": "object", "dynamic": true, "path": "full" }, 
                "@words" : { "type" : "string", "index" : "analyzed" },
                "@source" : { "type" : "string", "index" : "not_analyzed" },
                "@source_host" : { "type" : "string", "index" : "not_analyzed" },
                "@source_path" : { "type" : "string", "index" : "not_analyzed" },
                "@tags": { "type": "string", "index" : "not_analyzed" }, 
                "@timestamp" : { "type" : "date", "index" : "not_analyzed" },
                "@type" : { "type" : "string", "index" : "not_analyzed" }
            }
        }
    }
}
</code></pre>

<p>Please help</p>