filebeat-7.2.0服务输出形式

filebeat-7.2.0服务输出形式

 配置参考:https://www.elastic.co/guide/en/beats/filebeat/7.2/configuring-howto-filebeat.html

日志输出:https://www.elastic.co/guide/en/beats/filebeat/7.2/configuring-output.html

Filebeat只能有单一输出。

A、配置console输出格式

该格式在检验日志定位过程中,常用。

[root@linux-host2 filebeat-7.2.0-linux-x86_64]# vim filebeat.yml

output.console:

  pretty: true

 [root@linux-host2 filebeat-7.2.0-linux-x86_64]# ./filebeat -e -c filebeat.yml

可以查看实时日志。

 

 

B、配置file输出格式

该格式在检验日志定位过程中,也常用。

[root@linux-host2 filebeat-7.2.0-linux-x86_64]# vim filebeat.yml

output.file:

  path: "/tmp/fileb"

  filename: filebe

[root@linux-host2 filebeat-7.2.0-linux-x86_64]# ./filebeat -e -c filebeat.yml

自动生成目录和文件。

 

 

C、配置elasticsearch输出格式

不能手动创建索引,不建议使用

[root@linux-host2 filebeat-7.2.0-linux-x86_64]# vim filebeat.yml

output.elasticsearch:

  hosts: ["192.168.19.139:9200"]

[root@linux-host2 filebeat-7.2.0-linux-x86_64]# ./filebeat -e -c filebeat.yml

刷新界面,生成索引

 

暂无日志查看。

 

D、配置logstash输出格式

该格式配合es或者redis使用,以下是结合redis配置。

[root@linux-host2 filebeat-7.2.0-linux-x86_64]# vim filebeat.yml

output.logstash:

  hosts: ["192.168.19.138:5044"]

  enables: true

  worker: 1

  compression_level: 3

[log@linux-host1 logstash-7.2.0]$ cat conf.d/beats.conf

input {

  beats {

    port => 5044

  }

}

output {

  if [fields][service] == "tomcat-access-139"{

  redis {

    data_type => "list"

    host => "192.168.19.139"

    db => "4"

    port => "6379"

    key => "tomcat-access-139"

    password => "12345"

  }}

}

[root@linux-host2 filebeat-7.2.0-linux-x86_64]# ./filebeat -e -c filebeat.yml

[log@linux-host1 logstash-7.2.0]$ ./bin/logstash -f ./conf.d/beats.conf

访问tomcat服务,查看redis应用。

  

还有将输出kafka、elastic Cloud等应用中。

更多参考官网:https://www.elastic.co/guide/en/beats/filebeat/7.2/configuring-output.html

转载于:https://www.cnblogs.com/sunnyyangwang/p/11310798.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值