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"]
相关推荐
新*2 小时前
520 万数据迁移实战:Elasticsearch 索引重建与"改名"的完整踩坑记录
python·mysql·elasticsearch·数据迁移
阿里云大数据AI技术17 小时前
云栖实录|倍思科技 × 阿里云:让VOC洞察从“生成报告”走向“业务可用”
人工智能·elasticsearch·agent
大雪冬至6860612588720 小时前
【一次 Elasticsearch 高基数聚合慢查询的定位与优化】
elasticsearch
Elasticsearch21 小时前
Elasticsearch:如何使用 Connectors 接入数据到 Elastic Agent builder 里进行企业搜索
elasticsearch
wuyk5551 天前
Spider-第11讲-工程化改造与可维护性
大数据·爬虫·elasticsearch·搜索引擎
新*1 天前
Elasticsearch 索引别名入门:创建、路由、原子切换与几个常见误解
运维·后端·elasticsearch·索引别名
wuyk5551 天前
Spider-第12讲-asyncio异步并发爬取
大数据·爬虫·elasticsearch·搜索引擎
筑梦之人1 天前
Elasticsearch 9.x 从入门到精通(5/7):集群、分布式与运维
运维·分布式·elasticsearch
筑梦之人1 天前
Elasticsearch 9.x 从入门到精通(4/7):聚合分析与文本分析
大数据·elasticsearch·jenkins
Elasticsearch3 天前
过犹不及:为什么搜索结果重排序时,20 个候选结果胜过 200 个
elasticsearch