Sending json format log to kibana using filebeat, logstash and elasticsearch?

后端 未结 3 1926
既然无缘
既然无缘 2021-02-09 10:26

I have logs like this:

{\"logId\":\"57aaf6c8d32fb\",\"clientIp\":\"127.0.0.1\",\"time\":\"03:11:29 pm\",\"uniqueSubId\":\"57aaf6c98963b\",\"channelName\":\"JSPC\         


        
3条回答
  •  你的背包
    2021-02-09 10:55

    From FileBeat 5.x You can do it without using Logstash.

    Filebeat config:

    filebeat.prospectors:
    - input_type: log
      paths: ["YOUR_LOG_FILE_DIR/*"]
      json.message_key: logId
      json.keys_under_root: true
    
    output.elasticsearch:
      hosts: [""]
      template.name: filebeat
      template.path: filebeat.template.json
    

    Filebeat is more lightweight then Logstash. Also, even if you need to insert to elasticsearch version 2.x you can use this feature of FileBeat 5.x Real example can be found here

提交回复
热议问题