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"]
相关推荐
放学有种别跑、32 分钟前
GIT使用指南
大数据·linux·git·elasticsearch
越努力越幸运5082 小时前
git工具的学习
大数据·elasticsearch·搜索引擎
不会写程序的未来程序员2 小时前
详细的 Git 操作分步指南
大数据·git·elasticsearch
武子康2 小时前
大数据-167 ELK Elastic Stack(ELK) 实战:架构要点、索引与排错清单
大数据·后端·elasticsearch
20岁30年经验的码农3 小时前
Java Elasticsearch 实战指南
java·开发语言·elasticsearch
v***44675 小时前
springboot之集成Elasticsearch
spring boot·后端·elasticsearch
h***67378 小时前
SpringBoot整合easy-es
spring boot·后端·elasticsearch
ALex_zry18 小时前
Git大型仓库推送失败问题完整解决方案
大数据·git·elasticsearch
二进制coder19 小时前
Git Fork 开发全流程教程
大数据·git·elasticsearch
Elasticsearch1 天前
混合搜索无需头疼:使用 retrievers 简化混合搜索
elasticsearch