However, I would like to make some customizations to allow Metricbeat to only monitor specific containers, either by container name or image name. I have attempted to make these changes to my configuration, but I am still encountering an issue where Metricbeat is monitoring all containers instead of just the specified ones.
Could anyone provide guidance or assistance on how to properly configure Metricbeat to monitor specific Docker containers? I would greatly appreciate any help or suggestions.
Hello @Yungxin_Shin , you can use Drop Events processor (Drop events | Metricbeat Reference [8.6] | Elastic) in your metricbeat configuration (not in modules) and put a condition to NOT include required docker containers (If they are not many) or vice versa if containers to be dropped are less.
However, I'm not sure if this config will mess up the default configurations of the docker module. It would be great if you could provide some advice or suggestion on this.
@Yungxin_Shin the docker module and processor configuration on metricbeat are 2 separate things. When you use a processor, it doesn't alter any behavior of any module. To be more precise, here are the steps that will be followed:
Docker module polls the metrics and create an event with all the details.
Metricbeat checks the configuration for any event manipulation before sending event for ingestion.. and voilla, your processor is found.
drop_event processor is executed and conditions are checked on has_fields AND not.contains and decision is made to drop the event or not. AT this point, module has already completed its task of polling and creating the event -> so no messing up .
Once drop_event has made the decision, the event will or will not be sent for ingestion to your configured output.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.