默认的filebeat配置会把所有的索引都放到一个文件中,通过探索发现可以自界说索引的名字、模板、生命周期
(重点留意)该配置文件只适应于ES版本是8,不适应于其他版本
- /app/logs/info.log日志文件为JSON格式
- 自界说索引生命周期名为:pn_springboot,可提前建好
- 自界说索引名为:idx_springboot
- 自写义索引模板名为:tn_springboot
ES8版本默认生成的是数据流,不是默认的索引,这么配置生成的数据流名称就是idx_springboot,不是默认的filebeat了,如查索引发现生成长索引名是.ds-idx_springboot-2024.07.21-000001这种格式的,但我们配置视图时,选idx_springboot就行了
- filebeat.inputs:
- - type: filestream
- id: my-filestream-id
- enabled: true
- paths:
- - /app/logs/info.log
- parsers:
- - ndjson:
- keys_under_root: true
- overwrite_keys: true
- setup.template.name: "tn_springboot"
- setup.template.pattern: "idx_springboot"
- setup.template.overwrite: true
- setup.template.settings:
- index.lifecycle.name: "pn_springboot"
- index.number_of_replicas: 0
- output.elasticsearch:
- hosts: ["http://192.168.21.2:8800"]
- username: "elastic"
- password: "elastic"
- index: "idx_springboot"
复制代码 为保护我的个人隐私,有的生命周期名、索引名、模板名我做过修改,如发现有问题,可批评,或与我联系
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。 |