# Can I create different index patterns for different logs types in logstash?

**URL:** <https://discuss.elastic.co/t/can-i-create-different-index-patterns-for-different-logs-types-in-logstash/66588>\
**Category:** Logstash\
**Created:** [November 18, 2016, 8:17pm UTC](https://discuss.elastic.co/t/can-i-create-different-index-patterns-for-different-logs-types-in-logstash/66588 "2016-11-18T20:17:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![robertchen117](https://avatars.discourse-cdn.com/v4/letter/r/edb3f5/32.png) [@robertchen117](https://discuss.elastic.co/u/robertchen117)\
**Post date:** [November 18, 2016, 8:17pm UTC](https://discuss.elastic.co/t/can-i-create-different-index-patterns-for-different-logs-types-in-logstash/66588/1 "2016-11-18T20:17:37Z")

</div>

in logstash 2.4.1,

can I create different index patterns for different logs types?

I see if just one logstash-\* index pattern, it mess up all fields together.

thanks.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [November 19, 2016, 4:37am UTC](https://discuss.elastic.co/t/can-i-create-different-index-patterns-for-different-logs-types-in-logstash/66588/2 "2016-11-19T04:37:42Z")

</div>

You can use something like `index => "logstash--%{type}-%{+YYYY.MM.dd}"` - assuming you have a `type` value.

---

<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 17, 2016, 4:37am UTC](https://discuss.elastic.co/t/can-i-create-different-index-patterns-for-different-logs-types-in-logstash/66588/3 "2016-12-17T04:37:42Z")

</div>

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