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"]
相关推荐
好好沉淀18 小时前
Elasticsearch 中批量更新文档(Update By Query)的标准写法
大数据·elasticsearch
小程故事多_8018 小时前
Elasticsearch ES 分词与关键词匹配技术方案解析
大数据·人工智能·elasticsearch·搜索引擎·aigc
念丶小宇18 小时前
Git常用指令
大数据·git·elasticsearch
铭毅天下19 小时前
Python 同时适配 Elasticsearch 与 Easysearch 实战复盘
大数据·elasticsearch·搜索引擎·全文检索
历程里程碑20 小时前
滑动窗口------滑动窗口最大值
大数据·python·算法·elasticsearch·搜索引擎·flask·tornado
risc12345621 小时前
Elasticsearch 脚本系统的“坚实基础”
elasticsearch
liux352821 小时前
MySQL -> Canal -> Kafka-> ES 完整数据同步流程详解
mysql·elasticsearch·kafka
辰风沐阳21 小时前
git 忽略大小写(重命名文件)
大数据·git·elasticsearch
艺杯羹21 小时前
Git文件状态管理:从基础到进阶的完整指南
大数据·git·elasticsearch·版本控制·git教程·代码管理·git基础
Prince-Peng21 小时前
技术架构系列 - 详解Elasticsearch
大数据·elasticsearch·架构