Cherry-pick #12193 to 7.2: [Filebeat] Refactor autodiscover default input settings handling#12272
Merged
exekias merged 1 commit intoelastic:7.2from May 24, 2019
Merged
Conversation
…stic#12193) Autodiscover hints default config (unreleased) was done at the hints level, while it only makes sense for certain configs builder (logs). This change moves this logic to the `logs` builder and improves how users can define default settings for logs, ie: Enable hints but disable log retrieval by default: ``` filebeat.autodiscover: providers: - type: docker # or kubernetes hints.enabled: true hints.default_config.enabled: false ``` Only containers with the `co.elastic.logs/enabled: true` annotation will be retrieved. ``` filebeat.autodiscover: providers: - type: kubernetes # or docker hints.enabled: true hints.default_config: type: container paths: - /var/log/containers/*${data.container.id}.log ``` Logs are read by default for all containers, using the given input settings. Containers with `co.elastic.logs/enabled: false` annotation will be ignored. (cherry picked from commit e5fd309)
jsoriano
approved these changes
May 24, 2019
leweafan
pushed a commit
to leweafan/beats
that referenced
this pull request
Apr 28, 2023
…stic#12193) (elastic#12272) Autodiscover hints default config (unreleased) was done at the hints level, while it only makes sense for certain configs builder (logs). This change moves this logic to the `logs` builder and improves how users can define default settings for logs, ie: Enable hints but disable log retrieval by default: ``` filebeat.autodiscover: providers: - type: docker # or kubernetes hints.enabled: true hints.default_config.enabled: false ``` Only containers with the `co.elastic.logs/enabled: true` annotation will be retrieved. ``` filebeat.autodiscover: providers: - type: kubernetes # or docker hints.enabled: true hints.default_config: type: container paths: - /var/log/containers/*${data.container.id}.log ``` Logs are read by default for all containers, using the given input settings. Containers with `co.elastic.logs/enabled: false` annotation will be ignored. (cherry picked from commit 0d24fa2)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry-pick of PR #12193 to 7.2 branch. Original message:
Autodiscover hints default config disable (unreleased) was done at the hints
level, while it only makes sense for certain configs builder (logs).
This change moves this logic to the
logsbuilder and improves howusers can define default settings for logs, ie:
Enable hints but disable log retrieval by default, only containers with the
co.elastic.logs/enabled: trueannotation will be retrieved:Logs are read by default for all containers, using the given input
settings. Containers with
co.elastic.logs/enabled: falseannotationwill be ignored: