Skip to content
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

Cherry-pick #12193 to 7.2: [Filebeat] Refactor autodiscover default input settings handling #12272

Merged
merged 1 commit into from
May 24, 2019

Conversation

exekias
Copy link
Contributor

@exekias exekias commented May 24, 2019

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 logs builder and improves how
users can define default settings for logs, ie:

Enable hints but disable log retrieval by default, only containers with the co.elastic.logs/enabled: true annotation will be retrieved:

filebeat.autodiscover:
  providers:
    - type: docker # or kubernetes
      hints.enabled: true
      hints.default_config.enabled: false

Logs are read by default for all containers, using the given input
settings. Containers with co.elastic.logs/enabled: false annotation
will be ignored:

filebeat.autodiscover:
  providers:
    - type: kubernetes # or docker
      hints.enabled: true
      hints.default_config:
        type: container
        paths:
          - /var/log/containers/*${data.container.id}.log

…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)
@exekias exekias requested a review from a team as a code owner May 24, 2019 14:01
@exekias exekias merged commit 4eefd49 into elastic:7.2 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants