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版本)

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

相关推荐
阿里云大数据AI技术1 天前
大数据公有云市场第一,阿里云占比47%!
大数据
Lx3521 天前
Hadoop容错机制深度解析:保障作业稳定运行
大数据·hadoop
muyun28001 天前
Docker 下部署 Elasticsearch 8 并集成 Kibana 和 IK 分词器
elasticsearch·docker·容器
T06205141 天前
工具变量-5G试点城市DID数据(2014-2025年
大数据
向往鹰的翱翔1 天前
BKY莱德因:5大黑科技逆转时光
大数据·人工智能·科技·生活·健康医疗
鸿乃江边鸟1 天前
向量化和列式存储
大数据·sql·向量化
IT毕设梦工厂1 天前
大数据毕业设计选题推荐-基于大数据的客户购物订单数据分析与可视化系统-Hadoop-Spark-数据可视化-BigData
大数据·hadoop·数据分析·spark·毕业设计·源码·bigdata
java水泥工1 天前
基于Echarts+HTML5可视化数据大屏展示-白茶大数据溯源平台V2
大数据·echarts·html5
广州腾科助你拿下华为认证2 天前
华为考试:HCIE数通考试难度分析
大数据·华为
在未来等你2 天前
Elasticsearch面试精讲 Day 17:查询性能调优实践
大数据·分布式·elasticsearch·搜索引擎·面试