In the first case topic is a constant selector. It means that Filebeat sets the topic of events to a constant string always. There is no need to evaluate/run anything to determine the topic of the event.
In the second case a dynamic topic is set. This requires Filebeat to evaluate a format string and find a matching field for each event. The value of the matching field is going to be the topic. This process requires more resources than the first one.
However, log flow shouldn't be stopped in this case. Could you please share your full config formatted using </> and if possible debug logs in case of dynamic topics?
I am running filebeat in a kubernetes cluster providing limited resources for CPU(100m) and Memory(100Mi) and the CPU usage shoots upto 2000m within minutes of deployment of filebeat daemonset.
Here is the config:
filebeat.yml: |-
filebeat.config:
prospectors:
# Mounted `filebeat-prospectors` configmap:
path: ${path.config}/prospectors.d/*.yml
# Reload prospectors configs as they change:
reload.enabled: false
modules:
path: ${path.config}/modules.d/*.yml
# Reload module configs as they change:
reload.enabled: false
output.kafka:
hosts:
- <kafka-endpoint>:9092
topic: 'test-%{[kubernetes.namespace]}'
I can understand the fact that the dynamic topic evaluation would take up more resources. But I want to confirm if that increase would be 100 times.
Please let me know if any options setting in the config could cause this problem.
In order to address this, we should discard possible sources for this issue one by one. Can you confirm that removing the dynamic topic setting the CPU stays constant? Does it happen in all cases?
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.