1 yml文件配置
filebeat.inputs:
- type: log
??paths:
??- /home/vmuser/log/*.log
??#fields:
??fields_under_root: true
processors:
- drop_fields:
????fields: ["ecs","agent","host","input"]
logging:
????files:
??????rotateeverybytes: 10485760
output.elasticsearch:
??hosts: ["172.16.164.61:19200","172.16.164.62:19200","172.16.164.63:19200"]
??#索引自定義名稱加年月日
??index: "gxpt-%{+yyyy.MM.dd}"
#索引模板名稱
setup.template.name: "gxpt"
#模糊匹配索引模板
setup.template.pattern: "gxpt-*"
#關(guān)閉默認(rèn)的模板配置
setup.template.enabled: true
#開啟自定義的模板設(shè)置
setup.template.overwrite: true
#索引生命周期ilm默認(rèn)開啟署穗,網(wǎng)上說法開啟后索引名稱都是filebeat-*,這里我們自定義需要關(guān)閉
setup.ilm.enabled: false
配置完之后啟動(dòng)filebeat
2在kibana上關(guān)聯(lián)es索引
點(diǎn)擊Management -> Stack Management
選擇Kibana ->索引模式-> 創(chuàng)建索引模式
至此filebeat按天創(chuàng)建索引完成龙致,效果如下
想要在日志中可以查詢?nèi)罩荆枰谌罩九渲弥刑砑悠ヅ淠0?/p>