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"]
相关推荐
GISer_Jing6 小时前
Git协作开发:feature分支、拉取最新并合并
大数据·git·elasticsearch
高山莫衣12 小时前
git rebase多次触发冲突
大数据·git·elasticsearch
kobe_OKOK_12 小时前
【团队开发】git 操作流程
git·elasticsearch·团队开发
大只鹅20 小时前
Springboot3.3.4使用spring-data-elasticsearch整合Elasticsearch7.12.1
spring boot·elasticsearch
二闹1 天前
SLF4J/Logback 配置与 ELK 集成实战指南
后端·elasticsearch·logstash
G皮T1 天前
【Elasticsearch】全文检索 & 组合检索
大数据·elasticsearch·搜索引擎·全文检索·match·query·组合检索
Elastic 中国社区官方博客11 天前
如何在 Python 中连接 Elasticsearch 并使用 Qwen3 来实现 RAG
大数据·人工智能·python·elasticsearch·搜索引擎·阿里云·全文检索
jiedaodezhuti11 天前
Elasticsearch 如果保证读写一致
大数据·elasticsearch·搜索引擎
Elasticsearch11 天前
了解公共部门中的数据网格:支柱、架构和示例
elasticsearch
曾燕辉11 天前
kibana和elasticsearch安装
大数据·elasticsearch·搜索引擎·kibana