# Output Elasticsearch index name error

**URL:** <https://discuss.elastic.co/t/output-elasticsearch-index-name-error/271979>\
**Category:** Logstash\
**Created:** [May 3, 2021, 12:42pm UTC](https://discuss.elastic.co/t/output-elasticsearch-index-name-error/271979 "2021-05-03T12:42:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frack](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/frack/32/88134_2.png) [@Frack](https://discuss.elastic.co/u/Frack)\
**Post date:** [May 3, 2021, 12:42pm UTC](https://discuss.elastic.co/t/output-elasticsearch-index-name-error/271979/1 "2021-05-03T12:42:15Z")

</div>

I have a "logstash" index with documents while I have hardcoded the name of the output index by the tags.

when I check in the index "logstash" my logs have the right tag "windows" or "iptable" ...  
I added a final "else" to be sure  
I have try with 7.12.0 and 7.12.1 with the same result ☹  
I don't find why I've got the logstash index.

my output.conf

> output {  
> if "iptable" in [tags] {  
> elasticsearch {  
> index =\> "firewall"  
> hosts =\> ["[http://elasticsearch:9200](http://elasticsearch:9200)"]  
> }  
> }  
> else if "winlogbeats" in [tags] {  
> elasticsearch {  
> index =\> "winlogbeats"  
> hosts =\> ["[http://elasticsearch:9200](http://elasticsearch:9200)"]  
> }  
> }  
> else if "windows" in [tags] {  
> elasticsearch {  
> index =\> "windows"   
> hosts =\> ["[http://elasticsearch:9200](http://elasticsearch:9200)"]  
> }  
> }  
> else {  
> elasticsearch {  
> index =\> "notag"   
> hosts =\> ["[http://elasticsearch:9200](http://elasticsearch:9200)"]  
> }  
> }  
> }

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [May 3, 2021, 3:06pm UTC](https://discuss.elastic.co/t/output-elasticsearch-index-name-error/271979/2 "2021-05-03T15:06:26Z")

</div>

> [@Frack](#):
>
> I have a "logstash" index with documents while I have hardcoded the name of the output index by the tags.

When [ILM](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-ilm) is enabled the index option on the output is ignored.

---

<div class="post-metadata">

**Author:** ![Frack](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/frack/32/88134_2.png) [@Frack](https://discuss.elastic.co/u/Frack)\
**Post date:** [May 3, 2021, 4:53pm UTC](https://discuss.elastic.co/t/output-elasticsearch-index-name-error/271979/3 "2021-05-03T16:53:34Z")

</div>

Hello,  
I have add `ilm_enabled => "false"` to all my output .  
Now I have my notag index ✌  
but after remove all index and a full restart ELK

> logstash |yellow|open|1|1|1965 |920.8kb  
> firewall|yellow|open|1|1 |6 |114kb  
> notag|yellow open |1 |1 | 1959| 882.9kb

The Logstash index seen to be a copy of all the other index...

---

<div class="post-metadata">

**Author:** ![Frack](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/frack/32/88134_2.png) [@Frack](https://discuss.elastic.co/u/Frack)\
**Post date:** [May 4, 2021, 9:25am UTC](https://discuss.elastic.co/t/output-elasticsearch-index-name-error/271979/4 "2021-05-04T09:25:45Z")

</div>

Hello,  
find the solution in the log.  
there was in my pipeline a `output.conf.bak` before I try the index option.  
So I've got 2 output really stupid and simple .

---

<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:** [June 1, 2021, 9:25am UTC](https://discuss.elastic.co/t/output-elasticsearch-index-name-error/271979/5 "2021-06-01T09:25:48Z")

</div>

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