# How to define the shard settings in the logstash output configuration?

**URL:** <https://discuss.elastic.co/t/how-to-define-the-shard-settings-in-the-logstash-output-configuration/154407>\
**Category:** Logstash\
**Created:** [October 29, 2018, 9:26am UTC](https://discuss.elastic.co/t/how-to-define-the-shard-settings-in-the-logstash-output-configuration/154407 "2018-10-29T09:26:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bharath\_Pusuluri](https://avatars.discourse-cdn.com/v4/letter/b/b9bd4f/32.png) [@Bharath\_Pusuluri](https://discuss.elastic.co/u/Bharath_Pusuluri)\
**Post date:** [October 29, 2018, 9:26am UTC](https://discuss.elastic.co/t/how-to-define-the-shard-settings-in-the-logstash-output-configuration/154407/1 "2018-10-29T09:26:04Z")

</div>

The Elasticsearch and Logstash version using is 5.2.1, where can i define the shards settings in the below elasticsearch output pattern.

```
elasticsearch {
    index => "yarn-apps-logs-%{+YYYY.MM}"
    document_type => "doc"
    codec => "json"
    hosts => "XX.XX.XX.XX:9200"
    user => "xxxxx"
    password => "xxxxxx"

```

}

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [October 29, 2018, 9:29am UTC](https://discuss.elastic.co/t/how-to-define-the-shard-settings-in-the-logstash-output-configuration/154407/2 "2018-10-29T09:29:01Z")

</div>

You specify mappings and index setting through an [index template](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/indices-templates.html), not the Elasticsearch output configuration (although you can get the plugin to upload the template for you).

---

<div class="post-metadata">

**Author:** ![Bharath\_Pusuluri](https://avatars.discourse-cdn.com/v4/letter/b/b9bd4f/32.png) [@Bharath\_Pusuluri](https://discuss.elastic.co/u/Bharath_Pusuluri)\
**Post date:** [October 29, 2018, 9:34am UTC](https://discuss.elastic.co/t/how-to-define-the-shard-settings-in-the-logstash-output-configuration/154407/3 "2018-10-29T09:34:03Z")

</div>

for logstash, where can i find the template.

One more thing this should apply only to my selected set of index not at the system level.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [October 29, 2018, 9:40am UTC](https://discuss.elastic.co/t/how-to-define-the-shard-settings-in-the-logstash-output-configuration/154407/4 "2018-10-29T09:40:33Z")

</div>

You can look in Elasticsearch as the default one should be stored there. You can then take this and adapt it for your indices.

---

<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:** [November 26, 2018, 9:43am UTC](https://discuss.elastic.co/t/how-to-define-the-shard-settings-in-the-logstash-output-configuration/154407/5 "2018-11-26T09:43:26Z")

</div>

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