Hi there!
I'm having a strange problem when using a dissect clause into filebeat.
Here is my code:
- dissect:
when:
regexp:
message: '^.*\s#remotelogmessage#\shost_ip:.*$'
tokenizer: "%{[message]} #remotelogmessage# host_ip:%{[host][ip]}"
field: "message"
overwrite_keys: true
target_prefix: ""
For an unknown reason, even if I specify overwrite_keys: true, the message is not being overwritten.
When using it with the above code, I'm having this in the message field:
[INFO][pulp.agent.b3421482-750d-4125-8226-d5e52ea060ca] gofer.messaging.adapter.connect:30 - connected: proton+amqps://satellite6.sti.usherbrooke.ca:5647 #remotelogmessage#
I was able to confirm this by using another field name in the tokenizer settings. When replacing the tokenizer field by grostata instead of message like:
- dissect:
when:
regexp:
message: '^.*\s#remotelogmessage#\shost_ip:.*$'
tokenizer: "%{[grostata]} #remotelogmessage# host_ip:%{[host][ip]}"
field: "message"
overwrite_keys: true
target_prefix: ""
The field grostata will contain exactly what I want:
[INFO][pulp.agent.b3421482-750d-4125-8226-d5e52ea060ca] gofer.messaging.adapter.connect:30 - connected: proton+amqps://satellite6.sti.usherbrooke.ca:5647
...which is removing a special tag I'm using for other purpose (#remotelogmessage#).
So, this proves that my regex is working fine. At first, I thought it was wrong, but I later noticed that the key wasn’t being overwritten.
As soon as I put back message instead of grostata, the tag #remotelogmessage# will be present into message field.
Is there anyone have an idea on this issue?
Thank you all and Best Regards,
Yanick