Hi everyone,
I need some help with this, because I think it is something really simple, but is not working,
1. Describe your incident:
I’m working with CEF format events received from and ArcSight Logger, coming in CEF Syslog inside a JSON string. The “path” of the events is ArcSight Logger Forwarder CEF Syslog → Fluentbit Syslog Input → Fluentbit Kafka Output → Graylog Kafka Input.
After I do the CEF parsing with a pipeline rule, I’m trying to do a second pipeline rule to replace the message field every time that message field (msg in CEF) is not present in the original event, because in that cases, the message field in Graylog is the complete JSON/CEF string obtained from Kafka, and I want to replace it with the parsed name field (when msg is not present in the original event, I want msg and name to have the same content).
So, I can have to scenarios:
-
One, where both msg and name are present in the original event, and, after parsed with pipeline rules ends like this, for example, for a Fortigate event:
message:
progress IPsec phase 1
name:
event:vpn negotiate failure
In this case I don’t want to do anything, is ok -
Two, where msg is not present in the original event, and after parsed with pipeline rules ends like this, for example, for a Fortigate event:
message:{"@timestamp":1647168508.203043,“log”:“CEF:0|Fortinet|Fortigate|v6.4.7|forward|traffic:forward accept|Low| eventId=291293317 externalId=2234144878 start=1647168505000 end=1647168505000 app=DNS proto=UDP etc etc etc”}
name:
traffic:forward accept
In this case, I want to put the content of name field on message field
2. Describe your environment:
- OS Information:
Ubuntu 20.04 - Package Version:
Kubernetes, Kongz Helm Chart, using 4.2.7 version of Graylog
3. What steps have you already taken to try and solve the problem?
I tried to accomplish that with a simple pipeline rule:
rule "Regla Message"
when
is_json($message.message)
then
set_field("message", (to_string($message.name)));
end
I also tried as a condition on “when”
- is_json($message.message) == true
- starts_with(to_string($message.message), “{”)
- contains(to_string($message.message), “CEF”)
No option is working, I never get replaced the message field with the name field when the condition is true.
4. How can the community help?
Give me a piece of advice of what I’m doing wrong.
Thanks in advance,
Alejandro
Helpful Posting Tips: Tips for Posting Questions that Get Answers [Hold down CTRL and link on link to open tips documents in a separate tab]