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输出格式

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

[[email protected] filebeat-7.2.0-linux-x86_64]# vim filebeat.yml

output.console:

  pretty: true

 [[email protected] filebeat-7.2.0-linux-x86_64]# ./filebeat -e -c filebeat.yml

可以查看实时日志。

 filebeat-7.2.0服务输出形式

 

B、配置file输出格式

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

[[email protected] filebeat-7.2.0-linux-x86_64]# vim filebeat.yml

output.file:

  path: "/tmp/fileb"

  filename: filebe

[[email protected] filebeat-7.2.0-linux-x86_64]# ./filebeat -e -c filebeat.yml

自动生成目录和文件。

 filebeat-7.2.0服务输出形式

 

C、配置elasticsearch输出格式

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

[[email protected] filebeat-7.2.0-linux-x86_64]# vim filebeat.yml

output.elasticsearch:

  hosts: ["192.168.19.139:9200"]

[[email protected] filebeat-7.2.0-linux-x86_64]# ./filebeat -e -c filebeat.yml

刷新界面,生成索引

 filebeat-7.2.0服务输出形式

暂无日志查看。

 

D、配置logstash输出格式

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

[[email protected] 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

[[email protected] 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"

  }}

}

[[email protected] filebeat-7.2.0-linux-x86_64]# ./filebeat -e -c filebeat.yml

[[email protected] logstash-7.2.0]$ ./bin/logstash -f ./conf.d/beats.conf

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

 filebeat-7.2.0服务输出形式 

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

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

相关文章:

  • 2021-11-23
  • 2021-12-11
  • 2021-10-08
  • 2021-08-19
  • 2022-01-08
  • 2021-09-16
猜你喜欢
  • 2022-12-23
  • 2021-07-04
  • 2021-03-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案