Decompose Logstash json message into fields

前端 未结 4 1781
無奈伤痛
無奈伤痛 2021-02-01 21:46

It have a logfile that stores event with a timestamp and a json message. For example:

timestamp {\"foo\": 12, \"bar\": 13}

I would l

4条回答
  •  盖世英雄少女心
    2021-02-01 22:24

    You can just use plain Grok filters (regex style filters/patterns) and assign the matched value into a variable for easy organization, filtering and searching.

    An example:

    ((?(\"foo\"))):((?(\d+,)))
    

    Something along those lines.

    Use the GrokDebugger to help out if you get stuck on the syntax, patterns and things you think should be matching but aren't.

    Hope that helps a bit.

提交回复
热议问题