# Error with config file

**URL:** https://discuss.elastic.co/t/error-with-config-file/163471
**Category:** Logstash
**Created:** [January 9, 2019, 8:21am UTC](https://discuss.elastic.co/t/error-with-config-file/163471 "2019-01-09T08:21:26Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![cythwell](https://avatars.discourse-cdn.com/v4/letter/c/f475e1/32.png) [@cythwell](https://discuss.elastic.co/u/cythwell)
#### Post date: [January 9, 2019, 8:21am UTC](https://discuss.elastic.co/t/error-with-config-file/163471/1 "2019-01-09T08:21:26Z")

</div>

The config file like:

input {  
http {  
port =\> 20020  
}

filter {  
mutate {  
rename =\> ["shortHostname", "hostname"]  
}  
}

output {  
if [usageReports][level] == "top" {  
elasticsearch {  
action =\> "update"  
doc\_as\_upsert =\> true  
hosts =\> ["localhost:9200", "192.168.2.212:9200", "192.168.2.213:9200"]  
index =\> "hbovideo-%{+yyyy.MM.dd}"  
document\_id =\> "hbouser-%{[usageReports][userID]}"  
document\_type =\> "test\_data"  
}  
} else if [usageReports][level] == "second" {  
elasticsearch {  
action =\> "update"  
doc\_as\_upsert =\> true  
hosts =\> ["localhost:9200", "192.168.2.212:9200", "192.168.2.213:9200"]  
index =\> "hbovideo-%{+yyyy.MM.dd}"  
document\_id =\> "hbound-%{[usageReports][uniqueID]}"  
document\_type =\> "test\_data"  
}  
} else {  
elasticsearch {  
hosts =\> ["localhost:9200", "192.168.2.212:9200", "192.168.2.213:9200"]  
index =\> "hbovideo-%{+yyyy.MM.dd}"  
document\_type =\> "test\_data"  
}  
}  
}

For my troubleshooting, I am sure that the filter is the root cause, as I can perfect run with this configuration after remove filter part. But why? Is there any wrong with filter configuration?

---

<div class="post-metadata">

### Author: ![cythwell](https://avatars.discourse-cdn.com/v4/letter/c/f475e1/32.png) [@cythwell](https://discuss.elastic.co/u/cythwell)
#### Post date: [January 9, 2019, 8:24am UTC](https://discuss.elastic.co/t/error-with-config-file/163471/2 "2019-01-09T08:24:54Z")

</div>

I even tried remove everything inside fileter, like filter {}, it also went error.

---

<div class="post-metadata">

### Author: ![cythwell](https://avatars.discourse-cdn.com/v4/letter/c/f475e1/32.png) [@cythwell](https://discuss.elastic.co/u/cythwell)
#### Post date: [January 9, 2019, 9:46am UTC](https://discuss.elastic.co/t/error-with-config-file/163471/3 "2019-01-09T09:46:05Z")

</div>

this is the error

[ERROR] 2019-01-09 04:45:06.485 [Converge PipelineAction::Create] agent - Failed to execute action {:action=\>LogStash::PipelineAction::Create/pipeline\_id:main, :exception=\>"LogStash::ConfigurationError", :message=\>"Expected one of #, =\> at line 7, column 8 (byte 61) after input {\n http {\n port =\> 20020\n}\n\noutput {\n if ", :backtrace=\>["/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:41:in `compile_imperative'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:49:in`compile\_graph'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:11:in `block in compile_sources'", "org/jruby/RubyArray.java:2486:in`map'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:10:in `compile_sources'", "org/logstash/execution/AbstractPipelineExt.java:149:in`initialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:22:in `initialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:90:in`initialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline\_action/create.rb:42:in `block in execute'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:92:in`block in exclusive'", "org/jruby/ext/thread/Mutex.java:148:in `synchronize'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:92:in`exclusive'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline\_action/create.rb:38:in `execute'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:317:in`block in converge\_state'"]}

---

<div class="post-metadata">

### Author: ![cythwell](https://avatars.discourse-cdn.com/v4/letter/c/f475e1/32.png) [@cythwell](https://discuss.elastic.co/u/cythwell)
#### Post date: [January 9, 2019, 10:02am UTC](https://discuss.elastic.co/t/error-with-config-file/163471/4 "2019-01-09T10:02:00Z")

</div>

Found input part missing a "}" at the end.........Can run now..

---

<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: [February 6, 2019, 10:02am UTC](https://discuss.elastic.co/t/error-with-config-file/163471/5 "2019-02-06T10:02:04Z")

</div>

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