Dynamic configuration parameters

In filebeat configuration I would like to have dynamic variable like :

filebeat.inputs:

- type: ${some.type}
  enabled: true
  paths:
    - ${some.thing.like.variable}
  multiline.pattern: '^[[:space:]]+(at|\.{3})\b|^Caused by:'
  multiline.negate: false
  multiline.match: after

Is it possible to have like this ?

It is possible. Just make sure that the variables you are referencing can be resolved.

So that was my next question, is there a way to read form a configuration file ? or the variables should be preloaded in ENV ?

Environment variables can be used in the config. See more: https://www.elastic.co/guide/en/beats/filebeat/current/using-environ-vars.html

It is also possible to reference objects in the configuration.
For example ES hosts in the the following config object can be referenced as ${output.elasticsearch.hosts}:

output.elasticsearch:
  hosts: ["my-es:myport"]

Can you answer Multiline parsing patterns, thanks

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.