当前位置: 首页 > article >正文

filebeat收集日志直接输出到elasticsearch

filebeat收集日志直接输出到elasticsearch
配置/etc/filebeat/filebeat.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"]

http://www.kler.cn/news/365256.html

相关文章:

  • 代谢组数据分析(二十):通过WGCNA识别核心代谢物
  • 内置数据类型、变量名、字符串、数字及其运算、数字的处理、类型转换
  • 瑞芯微的 展会总结
  • Python基础知识-模块与包篇
  • 【331】基于Springboot的“有光”摄影分享网站系统
  • 软件设计师:软件工程
  • Redis的RDB执行原理
  • MyBatis 如何映射 Enum(使用 EnumTypeHandler、自定义 TypeHandler)
  • 判断特定时间点开仓的函数(编程技巧)
  • 程序结束、脚本语言、LISP、Python
  • Ubuntu22.04 更换源
  • 在linux中 appimage是什么文件? 为什么能直接运行
  • Sqoop数据采集
  • 利用java visualvm 分析内存溢出oom
  • Oracle 第1章:Oracle数据库概述
  • nginx配置文件详解
  • Docker 部署 EMQX 一分钟极速部署
  • 数据结构之顺序表——王道
  • 为了数清还有几天到周末,我用python绘制了日历
  • 两个yaml转成的 excel对比
  • Redis3
  • 【C】数组(array)
  • PHP PDO:安全、灵活的数据持久层解决方案
  • 【ios】---SwiftUI开发从入门到放弃
  • 每日一题——第一百一十八题
  • TCP控制位|标志位