Custom input codec configuration

Hi everybody.
I'm working on my very first codec for Logstash pipeline. The code itself works (according to unit tests).
This is the input configuration in LS pipeline:

input {
	jdbc {
		#stuff
		statement => "select * from mytable"
		codec => my_awesome_codec{}
	}
}

I receive this error when starting pipeline:

[2019-08-28T13:04:23,492][FATAL][logstash.runner] The given configuration is invalid. Reason: java.lang.NoSuchMethodException: my.package.MyAwesomeCodec.<init>(co.elastic.logstash.api.Configuration,co.elastic.logstash.api.Context)
[2019-08-28T13:04:23,523][ERROR][org.logstash.Logstash] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit

What could be the reason?

Run trace on the logstash.runner

Please, could you be more detailed? I'm totally new to the ELK stack.
Anyway, I was calling an old version of the plugin, which was missing a constructor with (co.elastic.logstash.api.Configuration,co.elastic.logstash.api.Context). Now I'm calling the right plugin, but the configuration is still invalid. This time the reason is unknown (for me), even adding --log.level trace as a parameter for logstash's executable.

You can do it as follows:
curl -XPUT '127.0.0.1:9600/_node/logging?pretty' -H 'Content-Type: application/json' -d'
{
"logger.logstash.runner" : "TRACE"
}
'

note: this setting will not survive logstash restart and must be placed in the logstash.yml

Thanks, I'll try.

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