Default values for value interpolation in autodiscovery

Is there a way to specify a default value for a value interpolation in the metricbeat configuration.

For example:

          # prometheus resource auto discovery
          - type: kubernetes
            cleanup_timeout: 0
              - ""
              - ""
              - ""
              - ""
              - condition:
                  - module: prometheus
                    period: 10s
                    # period: ${}
                    metricsets: ["collector"]
                    hosts: ["${}:${}"]
                    metrics_path: "${}"
                      - add_tags:
                          tags: ["autodiscover", "prometheus"]

If we look at the value for the period we'd like to be able to use the value provide IF it exists, and default to 10 seconds if it did not exist and similary for the metrics_path value.
I'd also be happy if this could be done using the conditions and implement a permutation of configurations to deal with the various cases that it could be.

ie. metrics_path: "{{ default '/metrics' }}" if using something like a golang template string.

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