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"]
相关推荐
水无痕simon4 小时前
5 索引的操作
数据库·elasticsearch
Qlittleboy2 天前
tp5集成elasticsearch笔记
大数据·笔记·elasticsearch
Elasticsearch2 天前
Elasticsearch:使用 Gradio 来创建一个简单的 RAG 应用界面
elasticsearch
kong@react2 天前
spring boot配置es
spring boot·后端·elasticsearch
Elasticsearch2 天前
Elasticsearch:如何使用 Qwen3 来做向量搜索
elasticsearch
Elastic 中国社区官方博客2 天前
Elasticsearch:如何使用 Qwen3 来做向量搜索
大数据·人工智能·elasticsearch·搜索引擎·全文检索
xiao-xiang3 天前
elasticsearch mapping和template解析(自动分词)!
大数据·elasticsearch·搜索引擎
Elastic 中国社区官方博客3 天前
超越相似名称:Elasticsearch semantic text 如何在简洁、高效、集成方面超越 OpenSearch semantic 字段
大数据·数据库·人工智能·elasticsearch·搜索引擎·ai·全文检索
现在,此刻3 天前
java面试题储备4: 谈谈对es的理解
java·开发语言·elasticsearch
Hello.Reader4 天前
Elasticsearch Node.js 客户端连接指南(Connecting)
elasticsearch·node.js·jenkins