# Output to Elastic sub index

**URL:** <https://discuss.elastic.co/t/output-to-elastic-sub-index/104129>\
**Category:** Logstash\
**Created:** [October 16, 2017, 5:12pm UTC](https://discuss.elastic.co/t/output-to-elastic-sub-index/104129 "2017-10-16T17:12:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![3for1](https://avatars.discourse-cdn.com/v4/letter/3/cab0a1/32.png) [@3for1](https://discuss.elastic.co/u/3for1)\
**Post date:** [October 16, 2017, 5:12pm UTC](https://discuss.elastic.co/t/output-to-elastic-sub-index/104129/1 "2017-10-16T17:12:42Z")

</div>

How should I configure the logstash output so that the data gets into a sub index.  
E.g:  
`index => "/food/%{food_type}"`

where food\_type is a field I have created in filter {}

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [October 16, 2017, 7:47pm UTC](https://discuss.elastic.co/t/output-to-elastic-sub-index/104129/2 "2017-10-16T19:47:28Z")

</div>

There is no such thing as a "sub index". Index names can't contain slashes.

---

<div class="post-metadata">

**Author:** ![3for1](https://avatars.discourse-cdn.com/v4/letter/3/cab0a1/32.png) [@3for1](https://discuss.elastic.co/u/3for1)\
**Post date:** [October 17, 2017, 10:15am UTC](https://discuss.elastic.co/t/output-to-elastic-sub-index/104129/3 "2017-10-17T10:15:26Z")

</div>

The proper nomenclature I was looking for is **type**

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [October 17, 2017, 11:18am UTC](https://discuss.elastic.co/t/output-to-elastic-sub-index/104129/4 "2017-10-17T11:18:47Z")

</div>

The elasticsearch output uses the `type` field as the document type. You can override that with the elasticsearch output's `document_type` option.

---

<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 14, 2017, 11:19am UTC](https://discuss.elastic.co/t/output-to-elastic-sub-index/104129/5 "2017-11-14T11:19:08Z")

</div>

Closed on November 14, 2017, 11:19am UTC

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