# Pb mix of indexes, using two or three conf file

**URL:** https://discuss.elastic.co/t/pb-mix-of-indexes-using-two-or-three-conf-file/292999
**Category:** Logstash
**Created:** [December 27, 2021, 8:11pm UTC](https://discuss.elastic.co/t/pb-mix-of-indexes-using-two-or-three-conf-file/292999 "2021-12-27T20:11:38Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Phildefer](https://avatars.discourse-cdn.com/v4/letter/p/9fc348/32.png) [@Phildefer](https://discuss.elastic.co/u/Phildefer)
#### Post date: [December 27, 2021, 8:11pm UTC](https://discuss.elastic.co/t/pb-mix-of-indexes-using-two-or-three-conf-file/292999/1 "2021-12-27T20:11:38Z")

</div>

Hello, I have set up two logstach pipelines via two conf files. One is going to look for an rss feed and the other one for tweets. In both, I have a different index type variable to differentiate obviously the data collected:

file : conf 1 (rss)  
input {  
rss {  
url =\> "[https://feeds.xxxxxxx](https://feeds.xxxxxxx/)"  
interval =\> 84600  
}  
}  
output {  
Elasticsearch {  
user =\> "elastic"  
password =\> "xxxxx"  
hosts =\> ["192.168.1.100:9200"]  
index =\> "rss"  
}  
}

file : conf 2 (twitter) :  
input {  
twitter {  
consumer\_key =\> "xxx"  
consumer\_secret =\> "xxxxx"  
oauth\_token =\> "xxxxxx"  
oauth\_token\_secret =\> "xxxxxx"  
keywords =\> ["xxxx", "xxxxx", "xxxx", "xxxx"]  
ignore\_retweets =\> true  
full\_tweet =\> true  
}  
}

filter {  
}

Elasticsearch {  
user =\> "elastic"  
password =\> "xxxxx"  
hosts =\> ["192.168.1.100:9200"]  
index =\> "twitter"  
document\_type =\> "tweet"  
}  
}

The problem is that when both conf files are in the pipeline directory, the twitter index in Elasticsearch ends up with the elements of the rss index.

I don't really understand the concern knowing that tested individually everything works.

If anyone has an idea.

Thank you.

---

<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: [December 27, 2021, 9:30pm UTC](https://discuss.elastic.co/t/pb-mix-of-indexes-using-two-or-three-conf-file/292999/2 "2021-12-27T21:30:58Z")

</div>

See [this](https://discuss.elastic.co/t/send-data-to-right-pipeline-from-two-csv-files/126700/3) answer. Tagging data at the input is just one approach. Using pipelines.yml to configure two pipelines is probably better.

It is a very common misconception that each configuration file stands alone.

---

<div class="post-metadata">

### Author: ![Phildefer](https://avatars.discourse-cdn.com/v4/letter/p/9fc348/32.png) [@Phildefer](https://discuss.elastic.co/u/Phildefer)
#### Post date: [December 29, 2021, 2:08pm UTC](https://discuss.elastic.co/t/pb-mix-of-indexes-using-two-or-three-conf-file/292999/3 "2021-12-29T14:08:30Z")

</div>

Hi, thanks for your answer. The solution was  
1 : add a conditionnal action when I assign an index to the output like this : if type=rss then index= rss. Otherwise logstash, even the index is assigned (without an if/then command) in the conf file, fill all of them  
2 : delete the conf files in the pipeline directory and store them in another one when there is already a file within (the default one). Otherwise logstash use them twice and fill the index two times ...

---

<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: [January 26, 2022, 2:08pm UTC](https://discuss.elastic.co/t/pb-mix-of-indexes-using-two-or-three-conf-file/292999/4 "2022-01-26T14:08:47Z")

</div>

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