Timestamps in event other than `@timestamp` will cause the plugin to crash
robbavey opened this issue · 1 comments
robbavey commented
Running the following pipeline will cause the codec to crash:
input { stdin {}}
filter { ruby { code => "event.set('[logstash_timestamp]', Time.now());" } }
output { stdout { codec => fluent }}
with the following error:
[2023-01-26T16:34:50,400][ERROR][logstash.javapipeline ][main] Pipeline worker error, the pipeline will be stopped {:pipeline_id=>"main", :error=>"(NoMethodError) undefined method `to_msgpack' for 2023-01-26T21:34:50.384Z:LogStash::Timestamp", :exception=>Java::OrgJrubyExceptions::NoMethodError, :backtrace=>["org.msgpack.jruby.Packer.write(org/msgpack/jruby/Packer.java:128)"
mashhurs commented
For now the workaround would be:
filter { ruby { code => "event.set('[logstash_timestamp]', LogStash::Timestamp.new(Time.now()).to_iso8601);" } }