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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to suppress pod metadata with log_namespace: true #20682

Open
Anton0C opened this issue Jun 17, 2024 · 3 comments
Open

Unable to suppress pod metadata with log_namespace: true #20682

Anton0C opened this issue Jun 17, 2024 · 3 comments
Labels
source: kubernetes_logs Anything `kubernetes_logs` source related type: bug A code related bug.

Comments

@Anton0C
Copy link

Anton0C commented Jun 17, 2024

A note for the community

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Problem

I have the following configuration in the Vector agent:

schema:
    log_namespace: true
...
sources:
    source_kubernetes:
      type: kubernetes_logs
      pod_annotation_fields:
        container_id: ""
        container_image_id: ""
        pod_labels: ""
        pod_owner: ""
...
    transform_namespace:
      type: remap
      inputs:
        - source_kubernetes
      source: |
        .event_data = .
        .meta_data = %

However, the pod_annotation_fields are still present, and the suppression doesn鈥檛 work as expected according to the documentation: https://vector.dev/docs/reference/configuration/sources/kubernetes_logs/#node_annotation_fields

What is wrong with the configuration, and how can I suppress these fields?

Configuration

No response

Version

0.38.0-debian

Debug Output

No response

Example Data

No response

Additional Context

No response

References

No response

@Anton0C Anton0C added the type: bug A code related bug. label Jun 17, 2024
@jszwedko
Copy link
Member

Does the pod metadata appear in the metadata (%) or the event (.)?

As a work around, you could delete these fields using a remap transform.

@jszwedko jszwedko added the source: kubernetes_logs Anything `kubernetes_logs` source related label Jun 18, 2024
@Anton0C
Copy link
Author

Anton0C commented Jun 19, 2024

Unsuppressed Pod metadata is still present in%kubernetes_logs. To avoid remap and additional resource consumption, it is better for it to work as described in the documentation.

@jszwedko
Copy link
Member

Unsuppressed Pod metadata is still present in%kubernetes_logs. To avoid remap and additional resource consumption, it is better for it to work as described in the documentation.

Thanks for confirming! I agree it is a bug that should be fixed, just that remap could be a workaround for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
source: kubernetes_logs Anything `kubernetes_logs` source related type: bug A code related bug.
Projects
None yet
Development

No branches or pull requests

2 participants