# Config has duplicate Ids

**URL:** <https://discuss.elastic.co/t/config-has-duplicate-ids/107991>\
**Category:** Logstash\
**Created:** [November 16, 2017, 4:58pm UTC](https://discuss.elastic.co/t/config-has-duplicate-ids/107991 "2017-11-16T16:58:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmh.01](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@bmh.01](https://discuss.elastic.co/u/bmh.01)\
**Post date:** [November 16, 2017, 4:58pm UTC](https://discuss.elastic.co/t/config-has-duplicate-ids/107991/1 "2017-11-16T16:58:15Z")

</div>

Has anyone ran into this before? The only thing I can find is this bug report that seems to be untouched from the alpha days.

[https://github.com/elastic/logstash/issues/7403](https://github.com/elastic/logstash/issues/7403)

Migrating my ELK stack from 5 to 6 and this is the error I'm running into, I've nailed it down to two configuration files which have filter blocks in them and it's the following statement in two of the config files that seems to be causing it.

```
if !("_grokparsefailure" in [tags]) {
    do some stuff
}

```

The funny thing is I use that statement in several other files and logstash doesn't complain about those! All I need to do is delete one of the 'conflicting' files and it will start up successfully, likewise removing the if statement from one of the files will also allow it to start.

The two files refer to two separate document types as well so this one has completely stumped me at the minute.

---

<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:** [November 16, 2017, 5:00pm UTC](https://discuss.elastic.co/t/config-has-duplicate-ids/107991/2 "2017-11-16T17:00:46Z")

</div>

> ```
> if !("_grokparsefailure" in [tags]) {
> 
> ```

This should work, but the canonical way of expressing it would be:

```
if "_grokparsefailure" not in [tags] {

```

---

<div class="post-metadata">

**Author:** ![bmh.01](https://avatars.discourse-cdn.com/v4/letter/b/3ab097/32.png) [@bmh.01](https://discuss.elastic.co/u/bmh.01)\
**Post date:** [November 16, 2017, 5:36pm UTC](https://discuss.elastic.co/t/config-has-duplicate-ids/107991/3 "2017-11-16T17:36:27Z")

</div>

Ok I didn't realise that i've changed the config to match that but unfortunately it's still referencing the same error which is strange now considering that exact syntax is no longer present. This is the full error below, it makes me wonder where it is getting it from now.

[2017-11-16T16:55:44,936][ERROR][logstash.agent] Failed to execute action {:action=\>LogStash::PipelineAction::Create/pipeline\_id:main, :exception=\>"Java::OrgLogstashConfigIr::InvalidIRException", :message=\>"Config has duplicate Ids: \nID: 290f61bfbcab108f22b4bb4135da94a4ff94d17a28c0ea88a3f4d63695fed4ef [if !(('\_grokparsefailure'.include?event.getField('[tags]')))],[if !(('\_grokparsefailure'.include?event.getField('[tags]')))]", :backtrace=\>["org.logstash.config.ir.graph.Graph.validate(org/logstash/config/ir/graph/Graph.java:292)", "org.logstash.config.ir.PipelineIR.(org/logstash/config/ir/PipelineIR.java:52)", "java.lang.reflect.Constructor.newInstance(java/lang/reflect/Constructor.java:423)", "org.jruby.javasupport.JavaConstructor.newInstanceDirect(org/jruby/javasupport/JavaConstructor.java:246)", "org.jruby.RubyClass.newInstance(org/jruby/RubyClass.java:1022)", "org.jruby.RubyClass$INVOKER$i$newInstance.call(org/jruby/RubyClass$INVOKER$i$newInstance.gen)", "RUBY.compile\_sources(/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:30)", "RUBY.compile\_lir(/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:107)", "RUBY.initialize(/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:49)", "RUBY.initialize(/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:215)", "org.jruby.RubyClass.newInstance(org/jruby/RubyClass.java:1022)", "org.jruby.RubyClass$INVOKER$i$newInstance.call(org/jruby/RubyClass$INVOKER$i$newInstance.gen)", "RUBY.execute(/usr/share/logstash/logstash-core/lib/logstash/pipeline\_action/create.rb:35)", "RUBY.block in converge\_state(/usr/share/logstash/logstash-core/lib/logstash/agent.rb:335)", "RUBY.with\_pipelines(/usr/share/logstash/logstash-core/lib/logstash/agent.rb:141)", "RUBY.block in converge\_state(/usr/share/logstash/logstash-core/lib/logstash/agent.rb:332)", "org.jruby.RubyArray.each(org/jruby/RubyArray.java:1734)", "org.jruby.RubyArray$INVOKER$i$0$0$each.call(org/jruby/RubyArray$INVOKER$i$0$0$each.gen)", "RUBY.converge\_state(/usr/share/logstash/logstash-core/lib/logstash/agent.rb:319)", "RUBY.block in converge\_state\_and\_update(/usr/share/logstash/logstash-core/lib/logstash/agent.rb:166)", "RUBY.with\_pipelines(/usr/share/logstash/logstash-core/lib/logstash/agent.rb:141)", "RUBY.converge\_state\_and\_update(/usr/share/logstash/logstash-core/lib/logstash/agent.rb:164)", "RUBY.execute(/usr/share/logstash/logstash-core/lib/logstash/agent.rb:90)", "RUBY.block in execute(/usr/share/logstash/logstash-core/lib/logstash/runner.rb:362)", "org.jruby.RubyProc.call(org/jruby/RubyProc.java:289)", "org.jruby.RubyProc.call19(org/jruby/RubyProc.java:273)", "org.jruby.RubyProc$INVOKER$i$0$0$call19.call(org/jruby/RubyProc$INVOKER$i$0$0$call19.gen)", "RUBY.block in initialize(/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/stud-0.0.23/lib/stud/task.rb:24)", "org.jruby.RubyProc.call(org/jruby/RubyProc.java:289)", "org.jruby.RubyProc.call(org/jruby/RubyProc.java:246)", "java.lang.Thread.run(java/lang/Thread.java:748)"]}  
[2017-11-16T16:55:44,938][ERROR][logstash.agent] An exception happened when converging configuration {:exception=\>LogStash::Error, :message=\>"Don't know how to handle `Java::OrgLogstashConfigIr::InvalidIRException` for `LogStash::PipelineAction::Create/pipeline_id:main`", :backtrace=\>["/usr/share/logstash/logstash-core/lib/logstash/converge\_result.rb:27:in `create'", "/usr/share/logstash/logstash-core/lib/logstash/converge_result.rb:67:in`add'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:347:in `block in converge_state'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:141:in`with\_pipelines'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:332:in `block in converge_state'", "org/jruby/RubyArray.java:1734:in`each'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:319:in `converge_state'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:166:in`block in converge\_state\_and\_update'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:141:in `with_pipelines'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:164:in`converge\_state\_and\_update'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:90:in `execute'", "/usr/share/logstash/logstash-core/lib/logstash/runner.rb:362:in`block in execute'", "/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/stud-0.0.23/lib/stud/task.rb:24:in `block in initialize'"]}

---

<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:** [December 14, 2017, 5:36pm UTC](https://discuss.elastic.co/t/config-has-duplicate-ids/107991/4 "2017-12-14T17:36:29Z")

</div>

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