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"]
相关推荐
我爱学习好爱好爱1 分钟前
Elasticsearch 7.17.10 双节点集群部署(二):安装 elasticsearch-head 插件实现可视化
大数据·linux·elasticsearch
Elastic 中国社区官方博客1 小时前
SearchClaw:将 Elasticsearch 通过可组合技能引入 OpenClaw
大数据·数据库·人工智能·elasticsearch·搜索引擎·ai·全文检索
无你想你8 小时前
Datawhale之春晚机器人跳舞复刻
大数据·elasticsearch·机器人
刘一说9 小时前
Git 工具知识全景图:从核心概念到高效协作实践
大数据·git·elasticsearch
MarsLord9 小时前
ElasticSearch快速入门实战(1)-索引、别名、建模最佳实践
大数据·elasticsearch·搜索引擎
阿干tkl9 小时前
openEuler 部署 Elasticsearch单节点与集群方式
elasticsearch
淘矿人9 小时前
【claude】05_Claude Skill 实战案例精选(上):开发类技能+weelinking中转服务
大数据·人工智能·python·elasticsearch·搜索引擎·cloudera
是垚不是土9 小时前
ClaudeCode×Elasticsearch:服务日志查询的 AI 化落地实践
大数据·运维·人工智能·elasticsearch·云计算·jenkins
etcix9 小时前
go cli translator that use bing api and youdao api
开发语言·elasticsearch·golang
Elastic 中国社区官方博客10 小时前
Elasticsearch:智能搜索 - AI Builder 及 Workflow
大数据·人工智能·elasticsearch·搜索引擎·ai·全文检索