添加Logstash采集日志

Avatar photo

1.下载 Logstash和 filebeat,解压缩。 code:  tar -zxf [文件名]
2. 配置filebeat:

    filebeat.inputs:
    - type: log
      enabled: true
      paths:
        - /var/log/*.log
    setup.kibana:
      host: "localhost:5601"
    output.logstash:
      hosts: ["127.0.0.1:5044"]
    

    3. 启动

    nohup ./filebeat -e -c filebeat.yml -d "publish" >>/dev/null 2>&1 &
    nohup ./filebeat -e -c filebeat.yml -d "publish" 1>>log/log.out 2>&1 &