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"]
相关推荐
mykyle15 小时前
Elasticsearch-8.17.0 centos7安装
大数据·elasticsearch·jenkins
躲在云朵里`18 小时前
Git的使用
大数据·git·elasticsearch
Elasticsearch21 小时前
Elastic 劳动力的生成式 AI:ElasticGPT 的幕后解析
elasticsearch
kong@react21 小时前
docker安装 Elasticsearch、Kibana、IK 分词器
elasticsearch·docker·jenkins
Elasticsearch1 天前
LlamaIndex 和 Elasticsearch Rerankers:无与伦比的简洁
elasticsearch
LiberInfo2 天前
MongoDB 副本集搭建与 Monstache 实时同步 Elasticsearch 全流程教程
数据库·mongodb·elasticsearch·搜索引擎·docker·kibana·monstache
用户463787610792 天前
linux安装单节点Elasticsearch(es),安装可视化工具kibana
elasticsearch
gorgor在码农2 天前
ElasticSearch基础数据查询和管理详解
大数据·elasticsearch·搜索引擎
菜萝卜子2 天前
【Ansible】Ansible 管理 Elasticsearch 集群启停
elasticsearch·ansible
Elastic 中国社区官方博客3 天前
使用 FastAPI 构建 Elasticsearch API
大数据·数据库·python·elasticsearch·搜索引擎·全文检索·fastapi