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"]
相关推荐
慕诗客3 小时前
repo管理多仓库
大数据·elasticsearch·搜索引擎
Elasticsearch11 小时前
Elasticsearch:运用 JINA 来实现多模态搜索的 RAG
elasticsearch
Rabbit_QL16 小时前
【Git基础】03——Git 撤销与回退:改错了怎么办
大数据·git·elasticsearch
Elastic 中国社区官方博客17 小时前
将 Logstash 管道从 Azure Event Hubs 迁移到 Kafka 输入插件
大数据·数据库·elasticsearch·microsoft·搜索引擎·kafka·azure
程序员 沐阳18 小时前
Git 二分法精准定位 Bug:从原理到实战,让调试效率起飞
git·elasticsearch·bug
heimeiyingwang18 小时前
【架构实战】搜索引擎架构:ElasticSearch集群设计
elasticsearch·搜索引擎·架构
Rabbit_QL19 小时前
【Git基础】02——分支:在不破坏主线的情况下做实验
大数据·git·elasticsearch
切糕师学AI19 小时前
Elasticsearch Learning to Rank 完全指南
大数据·elasticsearch·机器学习·搜索引擎
世人万千丶19 小时前
解决鸿蒙方向的Flutter框架版切换问题-当前最新版本3.35.8——工具切换与命令切换
学习·flutter·elasticsearch·华为·harmonyos·鸿蒙
Elastic 中国社区官方博客1 天前
通过自主 IT 平台和 Elastic 迈出可观测性的下一步
大数据·elasticsearch·搜索引擎·全文检索·可用性测试