美文网首页
windows下安装Filebeat

windows下安装Filebeat

作者: KwongRay | 来源:发表于2020-05-12 15:10 被阅读0次

    一、下载

    https://www.elastic.co/cn/downloads/beats/filebeat

    image.png

    二、修改配置

    下载完后,解压,打开filebeat.yml文件

    • 修改filebeat.inputs 为以下内容,其中paths为项目的日志路径
    filebeat.inputs:
    
    # Each - is an input. Most options can be set at the input level, so
    # you can use different inputs for various configurations.
    # Below are the input specific configurations.
    
    - type: log
    
      # Change to true to enable this input configuration.
      enabled: true
    
      # Paths that should be crawled and fetched. Glob based paths.
      paths:
        - F:\code\pscp-platform\logs\application\*\*.log
        #- c:\programdata\elasticsearch\logs\*
    
      # Exclude lines. A list of regular expressions to match. It drops the lines that are
      # matching any regular expression from the list.
      exclude_lines: ['\sDEBUG\s\d']
    
      # Include lines. A list of regular expressions to match. It exports the lines that are
      # matching any regular expression from the list.
      #include_lines: ['^ERR', '^WARN']
    
      # Exclude files. A list of regular expressions to match. Filebeat drops the files that
      # are matching any regular expression from the list. By default, no files are dropped.
      exclude_files: ['pscp-boot-admin.*.log$']
    
      # Optional additional fields. These fields can be freely picked
      # to add additional information to the crawled log files for filtering
      fields:
      #  level: debug
      #  review: 1
        docType: sys-log
        project: pscp-platform
    
      ### Multiline options
    
      # Multiline can be used for log messages spanning multiple lines. This is common
      # for Java Stack Traces or C-Line Continuation
    
      # The regexp Pattern that has to be matched. The example pattern matches all lines starting with [
      multiline:
        pattern: '^\[\S+:\S+:\d{2,}] '
        negate: true
        match: after
    
    • 修改output.logstash为以下内容,其中hosts为logstash的部署地址
    
    #----------------------------- Logstash output --------------------------------
    output.logstash:
      # The Logstash hosts
      hosts: ["localhost:5044"]
      bulk_max_size: 2048
    

    三、启动

    ./filebeat -c filebeat.yml -e

    相关文章

      网友评论

          本文标题:windows下安装Filebeat

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