zoukankan      html  css  js  c++  java
  • centos7搭建filebeat

    filebeat的环境搭建

    cd /home/elk
    wget https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-6.2.4-linux-x86_64.tar.gz
    tar -zvxf filebeat-6.2.4-linux-x86_64.tar.gz
    mv filebeat-6.2.4-linux-x86_64 filebeat

    修改配置文件

    filebeat.prospectors:
    - input_type: log
      paths:
        - /opt/dev/log/claimzuul/*.log
      document_type: "claimzuul" # 定义写入 ES 时的 _type 值
      multiline:
        #pattern: '^s*(d{4}|d{2})-(d{2}|[a-zA-Z]{3})-(d{2}|d{4})'   # 指定匹配的表达式(匹配以 2017-11-15 08:04:23:889 时间格式开头的字符串)
        pattern: '^s*("{)'                         # 指定匹配的表达式(匹配以 "{ 开头的字符串)
        negate: true                                # 是否匹配到
        match: after                                # 合并到上一行的末尾
        max_lines: 1000                             # 最大的行数
        timeout: 30s                                # 如果在规定的时候没有新的日志事件就不等待后面的日志
      fields:
        logsource: localhost
        logtype: claimzuul
    
    #- input_type: log
     # paths:
      #  - /var/log/messages
        #- /var/log/*.log
      #document_type: "syslog" # 定义写入 ES 时的 _type 值
      #fields:
       # logsource: localhost
        #logtype: syslog
    
    #output.elasticsearch:
    #  hosts: ["localhost:9200"]
    
    output.logstash:
      hosts: ["localhost:8082"]

    启动

    nohup ./filebeat -e -c filebeat.yml &

    借鉴https://www.cnblogs.com/xishuai/p/elk-elasticsearch-kibana-logstash-filebeat-log4j2.html

  • 相关阅读:
    Nginx 服务器安装及配置文件详解
    Linux 之 压缩解压缩
    RPM方式安装MySQL5.6
    Linux 之 搜索
    zabbix客户端安装
    JAVA输出指定目录下的子目录和子文件
    LoadRunner 11 安装破解
    SVN合并操作实践
    (转)SVN分支/合并原理及最佳实践
    MYSQL 免安装版(windows 7/64)
  • 原文地址:https://www.cnblogs.com/mutong1228/p/10186802.html
Copyright © 2011-2022 走看看