-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Autodiscover hints opt-in #7407
Comments
I'd love to see this as well. |
Why do we want to use special flag to explicitly enable logging for some containers? Why do we agree on fact that hints are supposed to enable logging for all containers even though it's disabled in configuration of autodiscover? It looks like implementing workaround for bug instead of fixing it. Why hints break autodiscover configuration? |
I agree with having a config flag that allows this behavior |
I'd really like to see this behaviour, we have 400 pods, and only about 30 have an annotation to actually care about the logs... so we're reading 370 other logs and overloading filebeat without reason. |
Bumped into this today as well. Enabling "hints" overrules the autoDiscover conditions, which is not desired. All kube-system pods get automatically included as well. It's not workable having to edit each of those deployments to add the annotation to not log them |
I think this issue is addressed by #10911, closing this. Please reopen if you think something else needs to be done. |
Hi @dudicoco,
Why this annotation is not enough in this case? Could you give more details on what is the problem on this scenario? If the problem is to have different selectors for each filebeat daemonset, you can use the For example with this configuration:
You can use annotations like these ones:
So one filebeat would be attending to If you try this, please report results back, I think we are lacking documentation and testing on this feature 🙁 |
Hi @jsoriano, thanks for the prompt reply! This feature is indeed undocumented. Is there a way to do something similar:
Thanks again :) |
@dudicoco then maybe you don't even need to use You can configure filebeat1 with the following configuration so it collects logs from all containers:
And filebeat2 with collection disabled by default:
Then only logs of pods with By the way, for questions on usage of Beats, or to discuss about possible bugs of missing features, please use https://discuss.elastic.co/ 🙂 |
@jsoriano I've already used a similar solution after digging in a bit more and it works! :) It would be beneficial to add Thank you! |
Nice to read it works for you, thanks! I have created an issue as follow up to improve the support of the |
Hi,
We have recently started to use Filebeat's autodiscovery mechanism to scrape logs from Kubernetes containers, however we don't want all files to be processed by default. Rather we want to enable an opt-in process for pod logs to be processed by beats and shipped to Elasticsearch.
Currently we are able to achieve this with the below config:
As expected, only logs from pods with the annotation
kubernetes.annotations.logging == true
are processed.However in addition to the above config, we also want to make use of the hints based autodiscover to handle cases where logs are multiline, or perhaps certain lines need to be excluded.
If I simply add
hints.enabled: true
to the above provider config, all Kubernetes logs begin to get processed (https://discuss.elastic.co/t/filebeat-autodiscover-hints-breaking-template/137310/8?u=evesy), and in addition those events aren't enriched with the cloud metadata.I've been informed of
co.elastic.logs/disable: true
as an option for the hints autodiscovery, however this would involve every pod that doesn't want logging to set this annotation (not everything deployed is in our control), making it an opt-out process.What I'd love is the ability to perform an inverse of this logic to make it strictly an opt-in process (i.e.
co.elastic.logs/enable: true
)I'm unable to currently find a way to do this.
In summary it'd be great if it was possible to use the hints autodiscovery to process Kubernetes logs but only for pods with a specific annotation on them
The text was updated successfully, but these errors were encountered: