cythwell
(Cythwell)
January 9, 2019, 8:21am
1
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?
cythwell
(Cythwell)
January 9, 2019, 8:24am
2
I even tried remove everything inside fileter, like filter {}, it also went error.
cythwell
(Cythwell)
January 9, 2019, 9:46am
3
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'"]}
cythwell
(Cythwell)
January 9, 2019, 10:02am
4
Found input part missing a "}" at the end.........Can run now..
system
(system)
Closed
February 6, 2019, 10:02am
5
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.