# Two indexes receiving same content regardless of logstash conf files

**URL:** https://discuss.elastic.co/t/two-indexes-receiving-same-content-regardless-of-logstash-conf-files/179828
**Category:** Logstash
**Created:** [May 6, 2019, 5:50pm UTC](https://discuss.elastic.co/t/two-indexes-receiving-same-content-regardless-of-logstash-conf-files/179828 "2019-05-06T17:50:06Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![heyabbottb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/heyabbottb/32/45651_2.png) [@heyabbottb](https://discuss.elastic.co/u/heyabbottb)
#### Post date: [May 6, 2019, 5:50pm UTC](https://discuss.elastic.co/t/two-indexes-receiving-same-content-regardless-of-logstash-conf-files/179828/1 "2019-05-06T17:50:06Z")

</div>

I've got two Logstash configuration files that each specify a different location for log files and then define the index for said log files.

The first:

```
input {
  file {
    path => "/elk/nmap/results/puppetserver/full/*"
    start_position => "beginning"
    sincedb_path => "/elk/nmap/sincedb/puppetserver"
  }
}

filter {
    json {
      source => "message"
    }
}

output {
  elasticsearch {
    hosts => ["127.0.0.1:9200"]
    index => "puppetserver"
  }
}

```

Second:

```
input {
  file {
    path => "/elk/nmap/results/saltmaster/full/*"
    start_position => "beginning"
    sincedb_path => "/elk/nmap/sincedb/saltmaster"
  }
}

filter {
    json {
      source => "message"
    }
}

output {
  elasticsearch {
    hosts => ["127.0.0.1:9200"]
    index => "saltmaster"
  }
}

```

For some reason, when I put logs into the puppetserver folder

```
/elk/nmap/results/puppetserver/full/

```

they get added to both indexes, and I can't figure out why. Any ideas?

Secondary question: nothing is being written to the sincedb files, so every time I restart logstash to add a new index, it re-adds all of the content again. File permissions are world write-able and read-able (I know those permissions are a bad idea, but I set them just for testing).

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [May 6, 2019, 6:11pm UTC](https://discuss.elastic.co/t/two-indexes-receiving-same-content-regardless-of-logstash-conf-files/179828/2 "2019-05-06T18:11:14Z")

</div>

Config files are concatenation so data from all inputs will go to all outputs unless you use conditionals. It is a very common misunderstanding so you should be able to find many examples here.

---

<div class="post-metadata">

### Author: ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)
#### Post date: [May 6, 2019, 7:12pm UTC](https://discuss.elastic.co/t/two-indexes-receiving-same-content-regardless-of-logstash-conf-files/179828/3 "2019-05-06T19:12:52Z")

</div>

Will it work with two different pipeline?

I had similar issue two config file was reading some data from database. some of the fields was same and output in index was getting messed up.

once I separated out both config under two different pipeline problem disappear.

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [May 6, 2019, 7:14pm UTC](https://discuss.elastic.co/t/two-indexes-receiving-same-content-regardless-of-logstash-conf-files/179828/4 "2019-05-06T19:14:01Z")

</div>

Yes, explicitly defining them as separate pipelines works as well.

---

<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 3, 2019, 7:14pm UTC](https://discuss.elastic.co/t/two-indexes-receiving-same-content-regardless-of-logstash-conf-files/179828/5 "2019-06-03T19:14:14Z")

</div>

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