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

rewrite_tag_filter sets message key to null with this installation #66

Open
r1ckr opened this issue Mar 11, 2021 · 5 comments
Open

rewrite_tag_filter sets message key to null with this installation #66

r1ckr opened this issue Mar 11, 2021 · 5 comments

Comments

@r1ckr
Copy link

r1ckr commented Mar 11, 2021

Hi guys, we are trying to use the rewrite_tag_filter with this docker image and after using it, it is setting the message key to null.

This is the bit of extra config that we are doing:

 # Splitting users logs
   <match kubernetes.var.log.containers.users**>
     @type rewrite_tag_filter
     <rule>
       key message
       pattern /access_log/
       tag access.${tag}
     </rule>
     <rule>
       key message
       pattern /.+/
       tag app.${tag}
     </rule>
   </match>
  
   # These ones are to see the output before sending the message to logzio
   <match app.kubernetes.var.log.containers.users**>
     @type stdout
   </match>

   <match access.kubernetes.var.log.containers.users**>
     @type stdout
   </match>

This produces the following output:

2021-03-11 11:20:47.710023717 +0000 access.kubernetes.var.log.containers.users-9d589d58-mnrqf_kube-namespace_users-452162d94859a803dcd8e6034dd516092302bfac76329123e9ecd130d031ff7a.log: {"stream":"stdout","type":"k8s","message":null,"docker":{"container_id":"452162d94859a803dcd8e6034dd516092302bfac76329123e9ecd130d031ff7a"},"kubernetes":{"container_name":"users","namespace_name":"kube-namespace","pod_name":"users-5785b46454-mnrqf","pod_id":"2aa0e7ce-b45c-482a-9d58-1c4cf906ebf1","host":"aks-secondary-a228a228-vmss000002","labels":{"app":"users","pod-template-hash":"5785b46454"},"master_url":"https://10.0.0.1:443/api","namespace_id":"9d9cd9bf-869a-4546-a228-71bb773523b2"}}
2021-03-11 11:20:49.359273955 +0000 access.kubernetes.var.log.containers.users-9d589d58-mnrqf_kube-namespace_users-452162d94859a803dcd8e6034dd516092302bfac76329123e9ecd130d031ff7a.log: {"stream":"stdout","type":"k8s","message":null,"docker":{"container_id":"452162d94859a803dcd8e6034dd516092302bfac76329123e9ecd130d031ff7a"},"kubernetes":{"container_name":"users","namespace_name":"kube-namespace","pod_name":"users-5785b46454-mnrqf","pod_id":"2aa0e7ce-b45c-482a-9d58-1c4cf906ebf1","host":"aks-secondary-a228a228-vmss000002","labels":{"app":"users","pod-template-hash":"5785b46454"},"master_url":"https://10.0.0.1:443/api","namespace_id":"9d9cd9bf-869a-4546-a228-71bb773523b2"}}

As you can see it rewrites the tag without issues, but the message key is then set to null.

If we isolate this config, it works OK and doesn't set to null the message key, the issue is with this image.

@mirii1994
Copy link
Contributor

mirii1994 commented Mar 29, 2021

Hi @r1ckr , can you please specify the image name & version that's causing you this issue?

@r1ckr
Copy link
Author

r1ckr commented Mar 29, 2021

Hi @mirii1994, yeah, we are using logzio/logzio-k8s:1.1.6

@mirii1994
Copy link
Contributor

We moved a couple of months ago to a new image: logzio/logzio-fluentd:1.0.0 and daemonset, which allows configuring fluentd from configmaps and not from the image itself.
Can you please try our latest daemonset & configmaps (you can configure the configmaps with your configuration), and let me know if this solves your issue? (Instructions on how to use the new daemonset/configmaps/image are in this repo and in our docs).

@r1ckr
Copy link
Author

r1ckr commented Apr 30, 2021

Hey @mirii1994, just updated to the latest image, still the same issue. Let me know if you need more info.

@mirii1994
Copy link
Contributor

Hi @r1ckr,
Seems like there is a collision between the rewrite_tags plugin & the record_modifier plugin. We will open an issue on the plugin page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants