# Multiple Indices in Output not working

**URL:** <https://discuss.elastic.co/t/multiple-indices-in-output-not-working/46880>\
**Category:** Logstash\
**Created:** [April 10, 2016, 1:05am UTC](https://discuss.elastic.co/t/multiple-indices-in-output-not-working/46880 "2016-04-10T01:05:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sameer\_Panicker](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@Sameer\_Panicker](https://discuss.elastic.co/u/Sameer_Panicker)\
**Post date:** [April 10, 2016, 1:05am UTC](https://discuss.elastic.co/t/multiple-indices-in-output-not-working/46880/1 "2016-04-10T01:05:05Z")

</div>

Based on the [type], matched events should be stored under "iislogs" index, but it is getting stored into "logstash" index.

What am I doing wrong here ?

input  
{  
file  
{  
type =\> "IISLogs"  
path =\> "C:/IISLogs/\*"  
}  
}  
output  
{  
if[type] == "IISLogs"  
{  
elasticsearch  
{  
index =\> "iislogs-%{+YYYY.MM.dd}"  
hosts =\> ["localhost:9200"]  
}  
}  
else  
{  
elasticsearch  
{  
index =\> "logstash-%{+YYYY.MM.dd}"  
hosts =\> ["localhost:9200"]  
}  
}  
stdout  
{  
codec =\> rubydebug  
}  
}

---

<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:** [April 10, 2016, 8:26pm UTC](https://discuss.elastic.co/t/multiple-indices-in-output-not-working/46880/2 "2016-04-10T20:26:06Z")

</div>

If you show an example message that gets stored in the wrong place maybe we can help. For example, show us the output of the stdout output.

---

<div class="post-metadata">

**Author:** ![Sameer\_Panicker](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@Sameer\_Panicker](https://discuss.elastic.co/u/Sameer_Panicker)\
**Post date:** [April 11, 2016, 3:53am UTC](https://discuss.elastic.co/t/multiple-indices-in-output-not-working/46880/3 "2016-04-11T03:53:12Z")

</div>

It was my mistake. I had renamed type to Type. I corrected that and it worked fine.

---

<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:** [July 6, 2017, 5:03am UTC](https://discuss.elastic.co/t/multiple-indices-in-output-not-working/46880/4 "2017-07-06T05:03:01Z")

</div>


