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"]
相关推荐
和科比合砍81分2 小时前
ES模块(ESM)、CommonJS(CJS)和UMD三种格式
大数据·elasticsearch·搜索引擎
AAA修煤气灶刘哥10 小时前
MySQL 查文本查哭了?来唠唠 ES 这货:从 “啥是 ES” 到 Java 撸代码,一篇整明白!
java·后端·elasticsearch
Elasticsearch14 小时前
什么是上下文工程 (Context Engineering)?
elasticsearch
白毛大侠16 小时前
如何安全地删除与重建 Elasticsearch 的 .watches 索引
大数据·elasticsearch·jenkins
Elastic 中国社区官方博客16 小时前
Elasticsearch 的 JVM 基础知识:指标、内存和监控
java·大数据·elasticsearch·搜索引擎·全文检索
Arthurmoo17 小时前
Git常用命令大全:高效开发必备
大数据·elasticsearch·搜索引擎
华农第一蒟蒻1 天前
Elasticsearch赋能3D打印机任务统计分析
java·大数据·spring boot·后端·elasticsearch·adb·maven
Elasticsearch1 天前
转变数据交互:在 Amazon Bedrock AgentCore Runtime 上部署 Elastic 的 MCP 服务器以构建 agentic AI 应用
elasticsearch
赤月幼狼2 天前
elasticsearch学习(五)文档CRUD
学习·elasticsearch
在未来等你2 天前
Elasticsearch面试精讲 Day 8:聚合分析与统计查询
大数据·分布式·elasticsearch·搜索引擎·面试