# Logstash 6.4.2 to use index pattern for new indices

**URL:** <https://discuss.elastic.co/t/logstash-6-4-2-to-use-index-pattern-for-new-indices/209033>\
**Category:** Logstash\
**Created:** [November 22, 2019, 9:18am UTC](https://discuss.elastic.co/t/logstash-6-4-2-to-use-index-pattern-for-new-indices/209033 "2019-11-22T09:18:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![samiujan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samiujan/32/23605_2.png) [@samiujan](https://discuss.elastic.co/u/samiujan)\
**Post date:** [November 22, 2019, 9:18am UTC](https://discuss.elastic.co/t/logstash-6-4-2-to-use-index-pattern-for-new-indices/209033/1 "2019-11-22T09:18:09Z")

</div>

Hi

I am using Logstash 6.4.2 to read and output data to a new ES 6.4.2 index every day - Each index has the pattern "filebeat-YYYY-MM-DD"

I want the new index to use a specific template

I have added an index template to ES with the following pattern:

```
PUT /_template/filebeat-geopoint
{
  "order": 0,
  "template": "filebeat-*",
  "settings": {},
  "mappings": {
    "_default_": {
      "properties": {
        "req_gp": {
          "type": "geo_point"
        }
      }
    }
  }
}

```

(I found the pattern [from this SO answer](https://stackoverflow.com/a/49809117/150878))

I want to configure Logstash so that it uses the pattern above - is the following configuration correct/sufficient?

```
output {
  elasticsearch {
    hosts => "localhost:9200"
    manage_template => true
    template_name => "filebeat-geopoint"
    template_overwrite => true
    index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
    document_type => "doc"
  }
}

```

I am not sure about the template\_overwrite attribute, is this necessary? Is "template\_name" sufficient or do I need to specify the template in a .json file as well

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 20, 2019, 9:18am UTC](https://discuss.elastic.co/t/logstash-6-4-2-to-use-index-pattern-for-new-indices/209033/2 "2019-12-20T09:18:14Z")

</div>

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