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"]
相关推荐
(; ̄ェ ̄)。4 分钟前
在nodejs中使用ElasticSearch(二)核心概念,应用
大数据·elasticsearch·搜索引擎
boy快快长大41 分钟前
【Elasticsearch】同一台服务器部署集群
服务器·elasticsearch·jenkins
一个儒雅随和的男子1 小时前
Elasticsearch除了用作查找以外,还能可以做什么?
大数据·elasticsearch·搜索引擎
跳跳的向阳花2 小时前
06、ElasticStack系列,第六章:elasticsearch设置密码
大数据·elasticsearch·jenkins
Elastic 中国社区官方博客12 小时前
Elasticsearch Open Inference API 增加了对 Jina AI 嵌入和 Rerank 模型的支持
大数据·人工智能·elasticsearch·搜索引擎·ai·全文检索·jina
隔壁老王15612 小时前
mysql实时同步到es
数据库·mysql·elasticsearch
SunnyRivers14 小时前
关于ES中text类型时间字段范围查询的结构化解决方案
elasticsearch·时间·text·范围查询
API_technology14 小时前
电商搜索API的Elasticsearch优化策略
大数据·elasticsearch·搜索引擎
stone.eye18 小时前
阿里云通过docker安装skywalking及elasticsearch操作流程
elasticsearch·阿里云·docker·skywalking
fruge1 天前
git上传 项目 把node_modules也上传至仓库了,在文件.gitignore 中忽略node_modules 依然不行
大数据·git·elasticsearch