美文网首页
Filebeat安装

Filebeat安装

作者: 袁先生的笔记 | 来源:发表于2018-01-02 11:25 被阅读0次

    环境

    系统:CentOS 6.9
    软件:filebeat-6.1.1-linux-x86_64.tar.gz

    安装

    配置

    # cd /usr/local/filebeat/
    # mv filebeat.yml filebeat.yml.org
    
    # vim filebeat.yml
    filebeat.prospectors:
      - type: log
      paths:
        - /App/tomcat/my-project/logs/localhost.*.log
      multiline.pattern: '^\s|^[A-Za-z]'
      multiline.match: after
      tail_files: true
      fields_under_root: true
      fields:
        project: my-project
        log_format: datatime-level-thread-class-content
    
    fields_under_root: true
    fields:
      deployment: test
    
    output.kafka:
      hosts: ["elk-kafka-1:9092"]
      topic: filebeat
      version: 0.10.2.1
    

    启动

    • 开机启动

      # vim /etc/rc.local
      cd /usr/local/filebeat/ && nohup ./filebeat >> logs/filebeat.log 2>&1 &
      
    • 启动

      # cd /usr/local/filebeat/
      # nohup ./filebeat >> /tmp/filebeat.log 2>&1 &
      

    相关文章

      网友评论

          本文标题:Filebeat安装

          本文链接:https://www.haomeiwen.com/subject/vrsvgxtx.html