filebeat收集日志直接输出到elasticsearch

filebeat收集日志直接输出到elasticsearch

配置/etc/filebeat/filebeat.yml

yml 复制代码
# configuration file.
# ============================== Filebeat inputs ===============================
filebeat.inputs:
- type: log
  enabled: true
  paths:
    - /mnt/logfile-nas/crs-center-service-*/*.log
  fields:
    app_name: appname
    profiles_active: pro
    app_node: hostname
  # 表示字段加在根节点下
  fields_under_root: true
  multiline.type: pattern
  multiline.pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2}'
  multiline.negate: true
  multiline.match: after
# ============================== Filebeat modules ==============================
filebeat.config.modules:
  path: ${path.config}/modules.d/*.yml
  reload.enabled: false
# ======================= Elasticsearch template setting =======================
setup.template.name: "template"
setup.template.pattern: "appname-*"
setup.template.settings.index.number_of_shards: 3
setup.template.settings.index.number_of_replicas: 1
#禁用索引生命周期管理,如果开启的话则会忽略我们自定义的索引
setup.ilm.enabled: false
setup.kibana:
# ---------------------------- Elasticsearch Output ----------------------------
output.elasticsearch:
  hosts: ["es1:9200", "es2:9200", "es3:9200"]
  index: "%{[app_name]}-%{[profiles_active]}-%{+YYYY.MM.dd}"
  username: "username"
  password: "password"
# ================================= Processors =================================
processors:
  - drop_fields:
        fields: ["ecs","host","agent","log","input"]
相关推荐
Elasticsearch12 分钟前
悦高软件带你体验 ES9.5 的性能跃升之路
elasticsearch
Elastic 中国社区官方博客41 分钟前
跳过 mapping 爆炸:ES|QL 无需动态 mapping 即可查询无 schema JSON key
大数据·人工智能·sql·elasticsearch·搜索引擎·json·全文检索
Gavynlee1 小时前
Git 操作问题排查与解决方案记录(Gitee 实战)
git·elasticsearch·gitee
菠萝猫yena16 小时前
【git】git 命令常用组合
大数据·git·elasticsearch
Sayai19 小时前
Elasticsearch 压测利器 esrally 从安装到跑分全流程
大数据·elasticsearch·搜索引擎
Zach_菠萝侠19 小时前
【DeepSeek Harness 研究】进化方向3:插件生态治理 思考、设计与实现
elasticsearch·deepseek
Elasticsearch1 天前
如何在 Workflow 里发送企业微信信息 - WeCom
elasticsearch
Elasticsearch1 天前
IT 领导者使用可观测性监控 AI 应用的 7 条经验
elasticsearch
哭哭啼1 天前
es ilm计算索引存在时间
大数据·elasticsearch·搜索引擎
SelectDB技术团队1 天前
腾讯音乐内容库 ES 替代:从 Elasticsearch 到 Apache Doris 统一搜索分析引擎实践
elasticsearch·django·apache doris