When I start Logstash I get the below error. I am trying to separate my Gelf and Filebeat input into different indices. Can anyone offer any help?
Inputs:
input {
gelf {
host => "10.16.0.5"
port => 20001
type => "Gelf"
}
}
input {
beats {
host => "10.16.0.5"
port => 5044
type => "Filebeat"
}
}
Outputs:
output {
if [type] == "Gelf"
{
elasticsearch {
hosts => "localhost:9200"
user => "elastic"
password => "dshufhu)}Wk47278C*gx@'fe29[=$$/:"
index => "Gelf-%{+YYYY.MM.dd}"
}
else
{
elasticsearch {
hosts => "localhost:9200"
user => "elastic"
password => "dshufhu)}Wk47278C*gx@'fe29[=$$/:"
index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"
}
}
}
[2018-01-19T16:48:24,625][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of #, => at line 29, column 23 (byte 425) after output {\nif [type] == "Gelf"\n {\n elasticsearch {\n hosts => "localhost:9200"\n user => "elastic"\n password => dshufhu)}Wk47278C*gx@'fe29[=$$/: index => "Gelf-%{+YYYY.MM.dd}"\n }\nelse\n {\n elasticsearch ", :backtrace=>["/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:42:in `compile_imperative'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:50:in `compile_graph'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:12:in `block in compile_sources'", "org/jruby/RubyArray.java:2486:in `map'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:11:in `compile_sources'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:51:in `initialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:171:in `initialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline_action/create.rb:40:in `execute'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:335: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:343: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'"]}
cheers,
G