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"]
相关推荐
GUET_一路向前7 小时前
【git工作常用指令】
大数据·git·elasticsearch
Elasticsearch8 小时前
通过 Elastic MCP Server 将 Cursor 连接到生产日志
elasticsearch
身如柳絮随风扬8 小时前
Spring Boot + Spring Cloud 集成 Elasticsearch:从零搭建企业级搜索服务
spring boot·elasticsearch·spring cloud
半部论语9 小时前
CentOS7 + pyenv 安装 Python 3.11 完整指南)
大数据·elasticsearch·python3.11
fan_music9 小时前
git使用教程
大数据·elasticsearch·搜索引擎
Elastic 中国社区官方博客11 小时前
通过受管控的控制平面加速商品陈列优化
大数据·数据库·人工智能·elasticsearch·搜索引擎·平面·ai
逸Y 仙X11 小时前
文章十五:ElasticSearch 运用ingest加工索引数据
java·大数据·elasticsearch·搜索引擎·全文检索
Elastic 中国社区官方博客11 小时前
Kibana 中的查询活动:用于长时间运行搜索的实时控制塔
大数据·运维·elasticsearch·搜索引擎·全文检索·kibana
byoass11 小时前
企业云盘全文检索实战:Elasticsearch集成与分布式搜索
网络·分布式·安全·elasticsearch·云计算·全文检索
Volunteer Technology12 小时前
Elasticsearch分布式原理
大数据·分布式·elasticsearch