filebeat部署流程及简单案例之fileteat采集Ubuntu系统日志


- filebeat环境搭建
	
    1.下载filebeat
略

	2.安装filebeat 
[root@elk93 ~]# dpkg -i filebeat-7.17.22-amd64.deb 

	3.查看filebeat的帮助信息
[root@elk93 ~]# filebeat -h
···
[root@elk93 ~]# 










filebeat采集Ubuntu系统日志案例:
	
案例描述:需要采集Ubuntu的系统日志/var/log/syslog,以及在/var/log/目录下所有以.log结尾的日志文件


[root@elk92 ~]# cat log_ubuntu_system-to-es.yaml
filebeat.inputs:
- type: log
  paths:
    - /var/log/syslog
    - /var/log/*.log

output.elasticsearch:
  hosts: 
  - "http://10.0.0.91:9200"
  - "http://10.0.0.92:9200"
  - "http://10.0.0.93:9200"
  index: "log-ubuntu-syslog"   #自定义索引名称

# 禁用索引的生命周期(Index Lifecycle Management,简称"ilm"),如果不禁用则忽略自定义索引名称
setup.ilm.enabled: false
# ES的索引模板名称
setup.template.name: "CUSTOM_NAME"
# ES索引模板的匹配模式,要匹配到上面你自定义的索引名称
setup.template.pattern: "log-ubuntu-syslog*"
# 如果索引模板已经存在,是否覆盖,推荐设置为false
setup.template.overwrite: false
# 设置索引模板
setup.template.settings:
  # 设置索引的分片数量
  index.number_of_shards: 5
  # 设置索引的副本数量
  index.number_of_replicas: 0
[root@elk92 ~]# 
[root@elk92 ~]# filebeat -e -c /root/log_ubuntu_system-to-es.yaml


	3.kibana过滤测试
略

posted @ 2026-07-30 22:29  张箐原  阅读(2)  评论(0)    收藏  举报