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"]
相关推荐
C-20023 小时前
基于 JumpServer 容器化部署 ES 集群
大数据·elasticsearch·搜索引擎
程序员Terry6 小时前
博客系统全文搜索实战:用 Elasticsearch 告别 MySQL LIKE 查询
后端·elasticsearch
jiayong239 小时前
Git 常见错误与详细解决方案
大数据·git·elasticsearch
jiayong2310 小时前
Git 分支命名、区别、联系与顺序关系说明
大数据·git·elasticsearch
jiayong2311 小时前
常用 Git 命令详解
大数据·git·elasticsearch
逸Y 仙X12 小时前
文章一:深度掌握Elasticsearch集群组建和集群设置
大数据·elasticsearch·搜索引擎·全文检索
前端若水12 小时前
版本控制:智能体提示与配置的CI/CD
大数据·elasticsearch·ci/cd
东北甜妹13 小时前
日志分析 Elasticsearch 和 logstach.filebeat.
大数据·elasticsearch·搜索引擎
C-200214 小时前
Elasticsearch 三节点集群部署
大数据·服务器·elasticsearch
随风,奔跑14 小时前
Elasticsearch全文检索服务
elasticsearch·全文检索