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

默认的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就行了

yaml 复制代码
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"

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

相关推荐
x***38167 小时前
springboot和springframework版本依赖关系
java·spring boot·后端
韩立学长8 小时前
基于Springboot课堂教学辅助系统08922bq1(程序、源码、数据库、调试部署方案及开发环境)系统界面展示及获取方式置于文档末尾,可供参考。
数据库·spring boot·后端
元拓数智8 小时前
IntaLink:破解数仓建设痛点,重塑高效建设新范式
大数据·数据仓库·人工智能·数据关系·intalink
区块链小八歌9 小时前
从电商收入到链上资产:Liquid Royalty在 Berachain 重塑 RWA 想象力
大数据·人工智能·区块链
沃达德软件9 小时前
大数据反诈平台功能解析
大数据·人工智能
音视频牛哥9 小时前
AI时代底层技术链:GPU、云原生与大模型的协同进化全解析
大数据·云原生·kubernetes·音视频·transformer·gpu算力·云原生cloud native
serendipity_hky9 小时前
互联网大厂Java面试故事:核心技术栈与场景化业务问题实战解析
java·spring boot·redis·elasticsearch·微服务·消息队列·内容社区
qq_328067819 小时前
springboot4 启动 Unable to find JSON tool
spring boot·json
howard20059 小时前
实训云上搭建大数据集群
大数据·大数据集群·实训云
大模型服务器厂商10 小时前
人形机器人的技术概况与算力支撑背景
大数据·人工智能