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"]
相关推荐
fangdengfu1235 小时前
ES分析系统各个服务日志占用量
java·前端·elasticsearch
兄台の请冷静7 小时前
Linux 安装es
linux·elasticsearch·jenkins
java_cj15 小时前
Elasticsearch索引管理完全指南:从基础API到ILM生命周期管理
大数据·后端·elasticsearch·性能优化
Shawn Dev15 小时前
团队协作中的 Git Tag 最佳实践:从入门到精通
大数据·git·elasticsearch
Dontla19 小时前
.gitkeep文件作用(让Git追踪空目录,使该目录能被纳入版本控制)!.gitkeep
大数据·git·elasticsearch
INFINI Labs1 天前
Elasticsearch 6/7/8 到 Easysearch 2.x 迁移指南
大数据·elasticsearch·mybatis·向量·snapshot
_codemonster1 天前
Git 最常用操作和原理
大数据·git·elasticsearch
阿里云大数据AI技术1 天前
Agentic Search + Memory:当企业研究遇上"会思考的搜索"
人工智能·elasticsearch
普通网友1 天前
springboot之集成Elasticsearch
spring boot·后端·elasticsearch
x_lrong2 天前
Ubuntu下安装配置Claude Code
linux·ubuntu·elasticsearch