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"]
相关推荐
Elasticsearch5 小时前
Elasticsearch:构建一个 AI 驱动的电子邮件钓鱼检测
elasticsearch
alan07216 小时前
【Java + Elasticsearch全量 & 增量同步实战】
java·elasticsearch·jenkins
Elastic 中国社区官方博客7 小时前
Elasticsearch:你是说,用于混合搜索(hybrid search)
大数据·数据库·人工智能·elasticsearch·搜索引擎·ai·全文检索
Elastic 中国社区官方博客11 小时前
在 Kibana 中可视化你的 Bosch Smart Home 数据
大数据·运维·elasticsearch·搜索引擎·信息可视化·全文检索·kibana
Dxy123931021612 小时前
Elasticsearch 聚合入门:像 Excel 透视表一样分析数据
elasticsearch·excel
Elastic 中国社区官方博客12 小时前
通过 Elasticsearch 中的 function score query 按利润和受欢迎程度提升电商搜索效果
大数据·数据库·elasticsearch·搜索引擎·全文检索
管理大亨13 小时前
智慧农业ELK落地方案:数据驱动精准农业
大数据·redis·python·elk·elasticsearch
神的泪水13 小时前
深度解析:基于 DeepSeek V3.2 与 Claude Code 构建终端智能体开发环境
大数据·elasticsearch·搜索引擎
Dxy123931021613 小时前
Elasticsearch 查询入门:像查字典一样简单
大数据·elasticsearch