elastic / beats

:tropical_fish: Beats - Lightweight shippers for Elasticsearch & Logstash
https://www.elastic.co/products/beats
Other
12.11k stars 4.91k forks source link

Filebeat Kubernetes variables fallback handling logic #40070

Open arturmouraa opened 1 month ago

arturmouraa commented 1 month ago

It would be helpful if Filebeat could handle the variables when it's referenced, but not defined. It should log an error in this case.

If the name value (E.g,${kubernetes.labels.app|[app.kubernetes.io/name](https://app.kubernetes.io/name)|[kubernetes.deployment.name](https://kubernetes.deployment.name/)|[kubernetes.statefulset.name](https://kubernetes.statefulset.name/)|[kubernetes.replicaset.name](https://kubernetes.replicaset.name/)}) don't have any matching substitution available, rather than falling back to setting null, it will just break the ingestion without an error.

To workaround this issue, it is possible to add the fallback constant unknown to the name value at the end.

E.g. ${kubernetes.labels.app|[app.kubernetes.io/name](https://app.kubernetes.io/name)|[kubernetes.deployment.name](https://kubernetes.deployment.name/)|[kubernetes.statefulset.name](https://kubernetes.statefulset.name/)|[kubernetes.replicaset.name](https://kubernetes.replicaset.name/)|"unknown"}

botelastic[bot] commented 1 month ago

This issue doesn't have a Team:<team> label.