Logstash - import nested JSON into Elasticsearch

久未见 提交于 2019-12-08 12:33:20

If you have control of what's being generated, the easiest thing to do is to format you input as single line json and then use the json_lines codec.

Just change your stdin to

stdin { codec => "json_lines" }

and then it'll just work:

cat input_file.json | logstash -f json_input.conf

where input_file.json has lines like

{"customerid":1,"nested": {"json":"here"}}
{"customerid":2,"nested": {"json":there"}}

And then you won't need the json filter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!