Parsing JSON in Logstash

后端 未结 1 1199
清歌不尽
清歌不尽 2021-02-09 15:44

I have some log files generated by Log4J2. I am outputting the logs into a .json file using the JSONLayout in the log4j2.xml configuration file. My JSONLayout is defined like th

相关标签:
1条回答
  • 2021-02-09 16:16

    You do not need to use the json filter. You can specify the codec format at your input.

    input {
        file {
           type => "json"
           path => "/var/logs/myApp/logs.log"
           codec => json
        }
    }
    

    Logstash will automatically parse your log to json format and add the corresponding field.

    0 讨论(0)
提交回复
热议问题