How to parse flatten json logs in logstash?

Getting error :-

[2022-05-03T22:21:09,874][INFO ][logstash.filters.flattenjson][main] Running flatten_json filter {:event=>#LogStash::Event:0x246b5df6}

[2022-05-03T22:21:09,880][ERROR][org.logstash.execution.WorkerLoop][main] Exception in pipelineworker, the pipeline stopped processing new events, please check your filter configuration and restart Logstash.
org.jruby.exceptions.NoMethodError: (NoMethodError) undefined method `keys' for #String:0x6c1a80ac
at RUBY.flatten(/vendor/local_gems/978a9a1d/logstash-filter-flatten_json-0.1.0/lib/logstash/filters/flatten_json.rb:68) ~[?:?]

please any idea for this

Hi,

cloud you share your logstash config.

Assuming that the filter is some variant of this, it expects the source to be a hash, and you have passed it text.

1 Like

Hi ibra_013

i am using filter this.

Hi Badger

i am reading flatten json file as same as other logs file, logstash-flatten-json-filter is this plugin fine to support flatten json or need to use another plugin?

Thank you

It is a third party filter, which is OK. But you need to pass it a field which is a hash, not a string.

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