filebeat多路径保存到不同index

使用tag区分

#配置多个input并指定tag
filebeat.inputs:

# Each - is an input. Most options can be set at the input level, so
# you can use different inputs for various configurations.
# Below are the input specific configurations.

- type: log

  # Change to true to enable this input configuration.
  enabled: true

  # Paths that should be crawled and fetched. Glob based paths.
  paths:
    - /data/logs/xxx-xxx-decision/*.log
  tags: ["xxx-xxx-decision"]
- type: log

  # Change to true to enable this input configuration.
  enabled: true

  # Paths that should be crawled and fetched. Glob based paths.
  paths:
    - /data/logs/system-manage/*.log
  tags: ["system-manage"]

# 根据tag保存到不同的Index
output.elasticsearch:
  # Array of hosts to connect to.
  hosts: ["10.254.193.137:9200"]
  
  indices:
    - index: "epu-bid-decision-%{[agent.version]}-%{+yyyy.MM.dd}"
      when.contains:
        tags: "epu-bid-decision"
    - index: "system-manage-%{[agent.version]}-%{+yyyy.MM.dd}"
      when.contains:
        tags: "system-manage"
    - index: "epu-bid-evaluation-%{[agent.version]}-%{+yyyy.MM.dd}"
      when.contains:
        tags: "epu-bid-evaluation"
  # Protocol - either `http` (default) or `https`.
  #protocol: "https"
#


参考
filebeat设置多个路径配置

posted @   Hey,Coder!  阅读(164)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 通过 API 将Deepseek响应流式内容输出到前端
· AI Agent开发,如何调用三方的API Function,是通过提示词来发起调用的吗
历史上的今天:
2021-05-27 wpf 移除listbox默认阴影、选中样式
2021-05-27 wpf 引用ttf viewmodel绑定
点击右上角即可分享
微信分享提示