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"]
相关推荐
斯普信专业组6 小时前
Filebeat写ElasticSearch故障排查思路(下)
运维·elasticsearch·中间件·filebeat
伊织code1 天前
Elasticsearch - 分布式搜索与分析引擎
大数据·分布式·elasticsearch
小松XXS1 天前
elasticsearch面试八股文
大数据·elasticsearch·面试
risc1234561 天前
【elasticsearch】序列化与反序列化机制
elasticsearch
Elasticsearch1 天前
Elastic AI agent builder 介绍
elasticsearch
Elasticsearch1 天前
MCP 工具:自主代理的攻击向量与防御建议
elasticsearch
和光同尘20231 天前
CentOS7搭建ELK日志分析系统
运维·elasticsearch·云原生·kubernetes·centos·kibana·logstash
Elastic 中国社区官方博客1 天前
理解 Elasticsearch 中的分块策略
大数据·数据库·人工智能·elasticsearch·搜索引擎·ai·全文检索
企鹅侠客1 天前
ElasticSearch-提高篇
大数据·elasticsearch·jenkins
llf_cloud2 天前
Elasticsearch8容器化部署
elasticsearch·docker·kibana