filebeta部署及配置文件详解

环境

  1. 系统:centos7.5
  2. ES:6.6
  3. kinbana
  4. filebeta:6.6.0
  5. 应用:tomcat/nginx日志文件
    filebeta和ES的版本最好对应
    filebeta参考地址:https://elkguide.elasticsearch.cn/beats/file.html
    filebeta及ES下载地址:https://elasticsearch.cn/download/

filebeta部署

1.上传文件只服务器指定目录

2. 解压缩

tar -zxvf filebeat-6.6.0-linux-x86_64.tar.gz

在这里插入图片描述

3. 修改filebeat.yml配置文件

下面示例为:根据日志头部时间分割

filebeat.inputs:
- type: log
  enabled: true
  paths:
    - /data/logs/helloApp/helloApp.info.log
  tail_files: true
  multiline:
    pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}'
    negate: true
    match: after
    max_lines: 1000
    timeout: 3s
  tags: ["helloApp-info-log"]
  fields:
    index: 'helloApp-info-log'
    appName: "helloApp"
    level: "info"
#数据源的配置
output.elasticsearch:
  hosts: ["ip:port","ip:port","ip:port"]
  username: "username"
  password: "password"
  indices:
    - index: "log-%{+yyyy.MM}"
      when.contains:
        fields:
          index: "helloApp-info-log"

启动

# 启动命令
$ ./filebeat -e -c filebeat.yml 
# 后台启动
nohup ./filebeat -e -c filebeat.yml -d "publish" >/dev/null 2>&1 &
$
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值