hi,
have following setup :
CentOS 7 machine
Logstash version : 6.2.4
elasticsearch version : 6.2.4-1
kibana : 6.2.4
all the services (logstash , kibana and elasticsearch we working fine ) .
following file is a input file to logstash service :
input {
file {
path => "/opt/apache-tomcat-8.5.31/logs/petclinic.log"
type => "log"
add_field => [ "app-name", "petclinic"]
codec => multiline {
pattern => "^%{TIMESTAMP_ISO8601}"
negate => true
what => previous
}
}jmx { path => "/etc/logstash/conf.d/" polling_frequency => 15 nb_thread => 4 type => "jmx" add_field => [ "app-name", "petclinic"] }
filter {
if [type] == "log" {
grok {
match => { "message" => "%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:loglevel}\s? [%{JAVACLASS:class}] - %{GREEDYDATA:logmessage}" }
}
}date { match => [ "timestamp" , "yyyy-MM-dd HH:mm:ss,SSS" ] }
}
output {
elasticsearch {
hosts => "http://localhost:9200/"
index => "pet"
}
}
}
and running the logstash command as follows :
logstash -f /etc/logstash/conf.d/logstash_input.conf --path.settings /etc/logstash/
but getting following error :
[2018-06-06T16:29:43,941][INFO ][logstash.modules.scaffold] Initializing module {:module_name=>"fb_apache", :directory=>"/usr/share/logstash/modules/fb_apache/configuration"}
[2018-06-06T16:29:43,961][INFO ][logstash.modules.scaffold] Initializing module {:module_name=>"netflow", :directory=>"/usr/share/logstash/modules/netflow/configuration"}
[2018-06-06T16:29:44,679][INFO ][logstash.runner ] Starting Logstash {"logstash.version"=>"6.2.4"}
[2018-06-06T16:29:44,862][INFO ][logstash.agent ] Successfully started Logstash API endpoint {:port=>9600}
[2018-06-06T16:29:45,078][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of #, => at line 23, column 8 (byte 495) after input {\n file {\n path => "/opt/apache-tomcat-8.5.31/logs/petclinic.log"\n type => "log"\n add_field => [ "app-name", "petclinic"]\n codec => multiline {\n pattern => "^%{TIMESTAMP_ISO8601}"\n negate => true\n what => previous\n }\n }\n\n jmx {\n path => "/etc/logstash/conf.d/"\n polling_frequency => 15\n nb_thread => 4\n type => "jmx"\n add_field => [ "app-name", "petclinic"]\n }\n\n\nfilter {\n if ", :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:169: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:315: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:312:in `block in converge_state'", "org/jruby/RubyArray.java:1734:in `each'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:299: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:348: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'"]}
not getting what the issue is and which configuration is missing ...
please suggest
Regards,