Use multiple codec in one file input ERROR After upgrade to logstash 6.3

It is working in the logstash version 5.6 . But not working in 6.3.2 It seems the input can not including two codec parameters . When I delete any one codecs. It is working. How to use both codec in logstash 6.3?

==================================

the input info like this .

input {
kafka {
bootstrap_servers => "localhost:9092"
topics => ["pglog","oshistory"]
codec => "json"
consumer_threads => 2
decorate_events => true
type => "pglog"
codec => multiline {
pattern => "^\d{4}-\d{1,2}-\d{1,2}"
negate => true
what => previous
}
}
}

=============================

Error in logstash 6.3

[root@db-testnode3 home]# /usr/share/logstash/bin/logstash -f logstash_postgresql_xian3.conf
WARNING: Could not find logstash.yml which is typically located in $LS_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaults
Could not find log4j2 configuration at path /usr/share/logstash/config/log4j2.properties. Using default config which logs errors to the console
[WARN ] 2018-07-30 15:50:19.607 [LogStash::Runner] multilocal - Ignoring the 'pipelines.yml' file because modules or command line options are specified
[INFO ] 2018-07-30 15:50:21.109 [LogStash::Runner] runner - Starting Logstash {"logstash.version"=>"6.3.2"}
[ERROR] 2018-07-30 15:50:24.518 [Converge PipelineAction::Create] agent - Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"TypeError", :message=>"no implicit conversion of Java::OrgLogstashConfigIrImperative::PluginStatement into String", :backtrace=>["org/jruby/RubyString.java:1144:in +'", "/usr/share/logstash/logstash-core/lib/logstash/compiler/lscl.rb:119:inblock in expr_attributes'", "org/jruby/RubyArray.java:1734:in each'", "org/jruby/RubyEnumerable.java:936:ininject'", "/usr/share/logstash/logstash-core/lib/logstash/compiler/lscl.rb:98:in expr_attributes'", "/usr/share/logstash/logstash-core/lib/logstash/compiler/lscl.rb:76:inexpr'", "org/jruby/RubyArray.java:2486:in map'", "/usr/share/logstash/logstash-core/lib/logstash/compiler/lscl.rb:69:inexpr'", "/usr/share/logstash/logstash-core/lib/logstash/compiler/lscl.rb:48:in block in compile'", "org/jruby/RubyArray.java:1734:ineach'", "/usr/share/logstash/logstash-core/lib/logstash/compiler/lscl.rb:46:in compile'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:46:incompile_imperative'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:50:in compile_graph'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:12:inblock in compile_sources'", "org/jruby/RubyArray.java:2486:in map'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:11:incompile_sources'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:49:in initialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline.rb:167:ininitialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline_action/create.rb:40:in execute'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:305:inblock in converge_state'"]}
[INFO ] 2018-07-30 15:50:25.587 [Api Webserver] agent - Successfully started Logstash API endpoint {:port=>9600}

=====================================

For any input plugin, you can only specify a single codec, and you have specified json and multiline. In this case you may need to keep the multiline codec and use a json filter instead of the codec.

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