filebeat把日志文件上传到Es中配置(ES7版本)

默认的filebeat配置会把所有的索引都放到一个文件中,通过摸索发现可以自定义索引的名字、模板、生命周期

(重点注意)该配置文件只适应于ES版本是7,不适应于8的版本,两个版本的配置文件差异很大

  • /app/logs/info.log日志文件为JSON格式
  • 自定义索引生命周期名为:pn_springboot,可提前建好
  • 自定义索引名为:idx_springboot
  • 自写义索引模板名为:tn_springboot

这样上传到es的索引名为idx_springboot-20240721-000001的索引名,不是默认的filebeat了

yaml 复制代码
filebeat.inputs:
- type: log
  paths:
    - /app/logs/info.log
  json.keys_under_root: true
  json.add_error_key: true
  json.overwrite_keys: true

setup.ilm.enabled: auto
setup.ilm.rollover_alias: "idx_springboot"
setup.ilm.pattern: "{now/d}-000001"
setup.ilm.policy_name: "pn_springboot"

setup.template.enabled: true
setup.template.name: "tn_springboot"
setup.template.pattern: "idx_springboot-*"
setup.template.overwrite: true
setup.template.settings:
  index.lifecycle.name: "pn_springboot"
  index.lifecycle.rollover_alias: "idx_springboot"

output.elasticsearch:
  hosts: ["http://192.168.21.2:8800"]
  username: "elastic"
  password: "elastic"

我是感觉这么配置有点不太合理,es版本是8的配置就比较合理了,ES8版本配置:filebeat把日志文件上传到Es中配置(ES8版本)

为保护我的个人隐私,有的生命周期名、索引名、模板名我做过修改,如发现有问题,可评论,或与我联系

相关推荐
黄雪超21 小时前
从流批一体到湖仓一体架构演进的思考
大数据·架构·数据湖
songyuc1 天前
【Git】请帮忙解释一下“git reset”
git·elasticsearch
Elastic 中国社区官方博客1 天前
Observability:适用于 PHP 的 OpenTelemetry:EDOT PHP 加入 OpenTelemetry 项目
大数据·开发语言·人工智能·elasticsearch·搜索引擎·全文检索·php
Elasticsearch1 天前
用 AI 驱动的威胁狩猎提升公共部门的网络防御
elasticsearch
白鲸开源1 天前
实战干货:Apache DolphinScheduler 参数使用与优化总结
大数据·程序员·开源
yumgpkpm1 天前
CMP(类Cloudera CDP 7.3 404版华为Kunpeng)与其他大数据平台对比
大数据·hive·hadoop·elasticsearch·kafka·hbase·cloudera
JZC_xiaozhong1 天前
跨系统流程如何打通?选 BPM 平台认准这三点
大数据·运维·自动化·数据集成与应用集成·业务流程管理·流程设计可视化·流程监控
中科岩创1 天前
某地公园桥梁自动化监测服务项目
大数据·人工智能·物联网·自动化
希赛网1 天前
2025年第四期DAMA数据治理CDGA考试练习题
大数据·cdga·cdgp·dama·数据治理·题库
keep__go1 天前
zookeeper单机版安装
大数据·运维·zookeeper