zoukankan      html  css  js  c++  java
  • FileBeat

    FileBeat使用说明

    FileBeat是一个日志收集器,基于Logstash-Forwarder的源代码。FileBeat一般以代理的身份运行在客户端服务器中,并监视用户指定的目录、文件,同时把日志文件更新部分推送给Logstash解析或者直接推送给ES索引。

    Alt text

    FileBeat的工作方式:
    当FileBeat在服务器上启动后,它同时启动一个或者多个prospectors来监视用户指定的日志文件目录。
    prospectors然后针对每个日志文件,都启动一个harvester,每一个harvester监视一个文件的新增内容,并把新增内容送到spooler中。然后spooler来汇总这些events事件。然后把这些事件传送给logstash或者es。

    一、 FileBeat的安装配置

    1. FileBeat的通用配置

    FileBeat的使用与ES、Logstash基本一样,从官方网站下载*.tar.gz文件,然后解压。添加配置文件,然后就可以运行了。

    如果用rpm或者deb的安装包,配置文件的位置在:/etc/filebeat/filebeat.yml

    下面是一个默认的配置文件:

    filebeat:
      # List of prospectors to fetch data.
      prospectors:
        # Each - is a prospector. Below are the prospector specific configurations
        -
          # Paths that should be crawled and fetched. Glob based paths.
          # For each file found under this path, a harvester is started.
          paths:
            - "/var/log/*.log"
            #- c:programdataelasticsearchlogs*
    
          # Type of the files. Based on this the way the file is read is decided.
          # The different types cannot be mixed in one prospector
          #
          # Possible options are:
          # * log: Reads every line of the log file (default)
          # * stdin: Reads the standard in
          input_type: log
          
          # Type to be published in the 'type' field. For Elasticsearch output,
    	  # the type defines the document type these entries should be stored
    	  # in. Default: log
    	  document_type: syslog
    ......
    

    input_type 决定了被监听文件的读取方式,同一个prospector不能混用不同的input_type, 可选的类型有logstdin
    document_type 会在日志的输出中增加一个type的字段。如果输入的对象是es,那么这个字段就是es中文档的类型

    在设置日志文件的路径时,每一个prospector监视一个路径(目录)。

  • 相关阅读:
    Flex 学习笔记 Remoting中的作用域(转)
    Flex 学习笔记 动态设置itemRenderer
    发现一个很好玩的网站个人漫画
    AjaxLoad动态生成加载图标的网站
    如何提高大字符串(是从文本文件读取出来的,有2M多)在网页中的显示速度
    CSS纵向居中问题
    用javascript进行xsl转换
    实现鼠标感应效果
    随笔写写
    execCommand指令集
  • 原文地址:https://www.cnblogs.com/stemon/p/6077259.html
Copyright © 2011-2022 走看看