Override module configuration on start


I would like to know if it was possible to override the configuration of a module with the option -E.
I tried several syntax but no effect.


yes, you can overwrite any configuration setting with -E, but you need to know the complete settings name and/or use json like syntax for more complex 'objects'. What is it exactly you want to solve/overwrite?

Yes, i already use -E for another setting. I want override hosts parameter for kubelet module (6.0.0 alpha1).

Can you share your metricbeat module configurations?

In metricbeat you configure the modules as array. This must reflect in the full path given by -E. For example -E metricbeat.modules.0.hosts="host1,host2".

Alternatively the config file format supports referencing other setting via ${<name>} syntax. One can use this to do this:

- type: ...
  hosts: ${myhosts}

Now you can run metricbeat by either setting myhosts as environment variable or overwrite it in the configs via -E:

  1. myhosts="host1,host2" metricbeat ...
  2. metricbeat -E myhosts="host1,host2" ...

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