本地动态提供程序

编辑

定义多个键值对以生成多个配置。

例如,以下 Elastic Agent 策略定义了一个本地动态提供程序,该提供程序为 item 定义了三个值

inputs:
 - id: logfile-${local_dynamic.my_var}
   type: logfile
   streams:
     - paths: "/var/${local_dynamic.my_var}/app.log"

providers:
  local_dynamic:
    items:
      - vars:
          my_var: key1
      - vars:
          my_var: key2
      - vars:
          my_var: key3

此策略生成的配置如下所示

inputs:
 - id: logfile-key1
   type: logfile
   streams:
     - paths: "/var/key1/app.log"
 - id: logfile-key2
   type: logfile
   streams:
     - paths: "/var/key2/app.log"
 - id: logfile-key3
   type: logfile
   streams:
   - paths: "/var/key3/app.log"