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

Add condition to the config file template for add_kubernetes_metadata #14056

Merged

Conversation

ChrsMark
Copy link
Member

This will make add_kubernetes_metadata processor to be only added by default to the configurations of beats with default indexers and matchers.

Closes #13713.

cc: @jsoriano , @exekias @odacremolbap

Signed-off-by: chrismark <chrismarkou92@gmail.com>
@ChrsMark ChrsMark requested a review from a team as a code owner October 15, 2019 08:56
@ChrsMark ChrsMark added Team:Integrations Label for the Integrations team containers Related to containers use case [zube]: In Review review labels Oct 15, 2019
- add_host_metadata: ~
- add_cloud_metadata: ~
- add_docker_metadata: ~
{{end}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this change be just adding the kubernetes processor within the existing list? Something like:

processors:
  - add_host_metadata: ~
  - add_cloud_metadata: ~
  - add_docker_metadata: ~
{{if .UseKubernetesMetadataProcessor}}
  - add_kubernetes_metadata: ~
{{end}}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was what I tried first, however this adds extra blank lines because of the template conditionals like:

processors:
  - add_host_metadata: ~
  - add_cloud_metadata: ~
  - add_docker_metadata: ~

  - add_kubernetes_metadata: ~

If this is ok, I can change it.

Copy link
Contributor

@exekias exekias Oct 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gotcha, try with {{- if ... -}}!

Copy link
Contributor

@exekias exekias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for taking this! I left a comment

Signed-off-by: chrismark <chrismarkou92@gmail.com>
Signed-off-by: chrismark <chrismarkou92@gmail.com>
Signed-off-by: chrismark <chrismarkou92@gmail.com>
Copy link
Contributor

@kaiyan-sheng kaiyan-sheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ChrsMark
Copy link
Member Author

CI failures seem to be irrelevant. Merging this.

@ChrsMark ChrsMark merged commit 637b0f9 into elastic:master Oct 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
containers Related to containers use case review Team:Integrations Label for the Integrations team v7.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add some condition to the configuration file template for add_kubernetes_metadata
5 participants