filebeat + es 日志分析

本文介绍了如何使用filebeat进行日志收集,配置filebeat.yml文件,启动filebeat,并通过ES管道预处理日志数据。同时,文章提到了使用supervisor确保filebeat稳定运行,以及设置定时任务清理ES中的过期日志索引,以优化存储空间。
摘要由CSDN通过智能技术生成

官网下载filebeat

下载及介绍,略。注意,保持fielbeat和es的版本一致,否则可能会报错。

配置filebeat.yml

主要是:

日志文件路径

单条日志多行合并

kibana和es连接

可以参考官网:https://www.elastic.co/guide/en/beats/filebeat/6.3/index.html

下面是我的配置:

###################### Filebeat Configuration Example #########################

# This file is an example configuration file highlighting only the most common
# options. The filebeat.reference.yml file from the same directory contains all the
# supported options with more comments. You can use it as a reference.
#
# You can find the full configuration reference here:
# https://www.elastic.co/guide/en/beats/filebeat/index.html

# For more available modules and options, please see the filebeat.reference.yml sample
# configuration file.

#=========================== Filebeat inputs =============================

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
  enabled: true
  paths:
    - /xxx/*/*/*.log
    - /xxx/xxx/*/*/*.log

  # exclude_files: ['/home/zile/prod-log/gateway/*/*/*/*']
  ignore_older: 12h
  tail_files: false
  # Optional additional fields. These fields can be freely picked
  # to add additional information to the crawled log files for filtering

  ### Multiline options 多行处理,匹配以日期开头的
  multiline.pattern: ^\[?\d{
   4}\-\d{
   
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值