# Logstash different .conf inputs are mixing up entries in indexes

**URL:** https://discuss.elastic.co/t/logstash-different-conf-inputs-are-mixing-up-entries-in-indexes/174144
**Category:** Logstash
**Created:** [March 27, 2019, 2:21pm UTC](https://discuss.elastic.co/t/logstash-different-conf-inputs-are-mixing-up-entries-in-indexes/174144 "2019-03-27T14:21:51Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![karo](https://avatars.discourse-cdn.com/v4/letter/k/e36b37/32.png) [@karo](https://discuss.elastic.co/u/karo)
#### Post date: [March 27, 2019, 2:21pm UTC](https://discuss.elastic.co/t/logstash-different-conf-inputs-are-mixing-up-entries-in-indexes/174144/1 "2019-03-27T14:21:51Z")

</div>

Before I go on, I have tried to look through the interwebs for an answer, I scoured the forums posts so much I feel I know the elk staff member names by heart (not really).

I do apologise if my insufficient research skills have failed me and I am now creating a duplicate post.

I have two configs in logstash: dev.conf, prod.conf  
dev.conf:

```
input {
	beats {
		port => 28777
		codec=>"json"
	}
}

filter {
	date {
		match => ["timestamp", "ISO8601"]
		target => "@timestamp"
	}
}

output {
	elasticsearch {
		index => "dev-log-index-1"
		hosts => ["localhost:9200"]
	}
}

```

prod.conf:

```
input {
	beats {
		port => 28000
		codec=>"json"
	        ssl => true
		ssl_certificate => "/etc/logstash/logstash.crt"
		ssl_key => "/etc/logstash/logstash.key"
		ssl_verify_mode => "force_peer"
		ssl_certificate_authorities => ["/etc/logstash/ca.crt"]
	}
}

filter {
	date {
		match => ["timestamp", "ISO8601"]
		 target => "@timestamp"
	}
}

output {

	elasticsearch {
		index => "prod-log-index-1"
		hosts => ["localhost:9200"]
	}
}`

```

I chose to separate the logs for different environments as such, although I find entries from dev-log-index-1 being attached to prod-log-index-1 and vice versa. As a result I am not able to see prod only or dev only logs under the corresponding kibana index pattern, even though these configs specify separate input ports and indexes.

---

<div class="post-metadata">

### Author: ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)
#### Post date: [March 27, 2019, 2:32pm UTC](https://discuss.elastic.co/t/logstash-different-conf-inputs-are-mixing-up-entries-in-indexes/174144/2 "2019-03-27T14:32:03Z")

</div>

You need to use [Multiple Pipelines](https://www.elastic.co/guide/en/logstash/current/multiple-pipelines.html), if you just create different `.conf` files and put them in the `conf.d` directory without changing the `pipelines.yml` file, they are treated as a unique pipeline.

You need something like this in your `pipeline.yml`

```auto
- pipeline.id: dev
  path.config: "/etc/logstash/conf.d/dev.conf"
- pipeline.id: prod
  path.config: "/etc/logstash/conf.d/prod.conf"

```

---

<div class="post-metadata">

### Author: ![karo](https://avatars.discourse-cdn.com/v4/letter/k/e36b37/32.png) [@karo](https://discuss.elastic.co/u/karo)
#### Post date: [March 27, 2019, 2:34pm UTC](https://discuss.elastic.co/t/logstash-different-conf-inputs-are-mixing-up-entries-in-indexes/174144/3 "2019-03-27T14:34:43Z")

</div>

Much obliged Jumping right on it, I'll let you know how it went!

---

<div class="post-metadata">

### Author: ![karo](https://avatars.discourse-cdn.com/v4/letter/k/e36b37/32.png) [@karo](https://discuss.elastic.co/u/karo)
#### Post date: [March 27, 2019, 3:21pm UTC](https://discuss.elastic.co/t/logstash-different-conf-inputs-are-mixing-up-entries-in-indexes/174144/4 "2019-03-27T15:21:58Z")

</div>

Worked like a charm! Thank you very much. Hope this helps anyone who has the same issue.

---

<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: [April 24, 2019, 3:22pm UTC](https://discuss.elastic.co/t/logstash-different-conf-inputs-are-mixing-up-entries-in-indexes/174144/5 "2019-04-24T15:22:07Z")

</div>

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