Hi,
I'm using a Cisco Router and when I set initially the forwarder to include a CISCO_ROUTER forwarder, it provided very little information in the UDM.
I then I switched to a CISCO_VPN forwarder that didn't parse my log entry at all and then when I tried the CISCO_SWITCH forwarder, I'm getting more information, as you can see herein, but not the important information I need.
That's the RAW log:
<14>1 2024-11-10T21:23:25+08:00 router0ABCD log_sslvpnac - - [meta sequenceId="16"] facility=SslVpn;msg=INFO sslvpn_appl.c.146[747CF470] Client is Web Browser;
That's the UDM. As you can see, the msg data (that I need), wasn't parsed:
metadata.base_labels.allow_scoped_access = true
metadata.base_labels.log_types = "CISCO_SWITCH"
metadata.base_labels.namespaces = "LAN"
metadata.event_timestamp.seconds = 1731245064
metadata.event_timestamp.nanos = 229863000
metadata.event_type = "STATUS_UPDATE"
metadata.id = "AAAAAF2JL0NEDomaQVosIKN7W6cAAAAABgAAAA8AAAA="
metadata.ingested_timestamp.seconds = 1731245064
metadata.ingested_timestamp.nanos = 229863000
metadata.log_type = "CISCO_SWITCH"
metadata.product_event_type = "log_sslvpnac"
metadata.product_name = "Cisco Switch"
metadata.vendor_name = "Cisco"
principal.asset.hostname = "router0ABCD"
principal.hostname = "router0ABCD"
principal.namespace = "LAN"
Is it possible to add in the events section of the Rule Editor the ability to search for a string in the raw log itself, or am I forced to modify the parser (which I don't know how)?
Alternatively, is there another Cisco forwarder anyone can recommend that may yield a better outcome?
Thanks
Solved! Go to Solution.
I managed to create this extension that I could validate. It doesn't breakdown the fields like I wanted, but using RegEx afterwards does yield the outcome I need:
filter {
mutate {
replace => {
"syslog" => ""
"description" => ""
}
}
grok {
match => {
"message" => ["(?<syslog>.*?)\[meta sequenceId=\"\d+\"\]\s*(?<description>.*)"]
}
overwrite => ["syslog", "description"]
}
if [description] != "" {
mutate {
replace => {
"event.idm.read_only_udm.metadata.description" => "%{description}"
}
}
}
#statedump{}
mutate {
merge => {
"@output" => "event"
}
}
}
I hope that it will be useful to other members of this community
You cannot use raw log in yara-l.
You either need to modify the parser or submit a request to support with the specific fields you need to get that parsed correctly.
Thanks @dnehoda
So, This is the raw and UDM log that is partially parsed:
I want to create a parser extension:
What are the values we should put in the Syslog & Target fields to extract and unify the user, IP and login state?
Thanks
Please see this - https://cloud.google.com/chronicle/docs/event-processing/using-parser-extensions#syslog_extractor
The syslog field is used to define the pattern to identify the Syslog header and the raw log message.
Thanks @cmorris . That's the doc I was looking for.
So, I built this filter, but it's being refused by the system:
%{TIMESTAMP_ISO8601} %{WORD:host} %{WORD:type} ([- ]+)?%{GREEDYDATA:meta} User %{WORD:user} %{WORD:status} from %{IP:ip}
The error I'm getting is:
generic::internal: failed to run grok filter: failed to parse data with all match patterns
What should I do? I want to extract into the metadata of the UDM the user, status and IP from this message and only for jsonproc type:
`
<14>1 2024-11-11T12:39:58+08:00 router0ABCD jsonrpc - - [meta sequenceId="6258"] User jlxx logged out from 10.0.0.142
Thanks
I posted the same doc below its just down the page a little.
Anyhow, something doesn't seem okay with your log. I see 33 fields being parsed in my lab.
@JuLenny - try that....sorry it was late last night and I couldn't respond.
%{TIMESTAMP_ISO8601} %{WORD:host} %{WORD:type} ([- ]+)?%{GREEDYDATA:meta} User %{WORD:user} %{WORD:status} out from %{IP:ip}
Hi @dnehoda
Thanks for your continued assistance on this.
I tried to input the string that you sent into the SYSLOG field, but may have done it incorrectly, as you can see herein:
Can you advise what's wrong here? Also, how do I make sure that all 3 fields that I want are included in the UDM metadata?
Thanks
Hi @dnehoda & @cmorris ,
I managed to build a Grok filter that extracts all the values that I need for that specific application (jsonrpc):
%{TIMESTAMP_ISO8601:timestamp} %{WORD:device} %{WORD:application} - - %{GREEDYDATA:meta} User %{WORD:user} %{GREEDYDATA:status} from %{IP:source_ip}
This is the output of the Grok Debugger:
Then, I tried to create a CBN snippet, using that Grok filter:
filter {
grok {
match => { "message" => "%{TIMESTAMP_ISO8601:timestamp} %{WORD:device} %{WORD:application} - - %{GREEDYDATA:meta} User %{WORD:user} %{GREEDYDATA:status} from %{IP:source_ip}" }
}
}
This is what it looks like:
But something in missing from my code, as during the validation, it tries to run on the last message received from the switch (not jsonrpc) and since the syntax is different, it fails:
I tried to review the online guide for this, but didn't understand what to put in the code to dedicate this Grok filter to the specific jsonrpc application.
What am I doing wrong? I feel that I'm close, but I don't know how to proceed.
Thanks for your help
Hi again everyone
Does anyone here has any experience with parser extensions for syslog messages? I couldn't find anything relevant in the documentation.
Thanks
I managed to create this extension that I could validate. It doesn't breakdown the fields like I wanted, but using RegEx afterwards does yield the outcome I need:
filter {
mutate {
replace => {
"syslog" => ""
"description" => ""
}
}
grok {
match => {
"message" => ["(?<syslog>.*?)\[meta sequenceId=\"\d+\"\]\s*(?<description>.*)"]
}
overwrite => ["syslog", "description"]
}
if [description] != "" {
mutate {
replace => {
"event.idm.read_only_udm.metadata.description" => "%{description}"
}
}
}
#statedump{}
mutate {
merge => {
"@output" => "event"
}
}
}
I hope that it will be useful to other members of this community
You can also create a parser extension to parse our the value of msg. That way you are not customizing a standard parser.
Yes. That's exactly what I'm trying to do
Sorry. The message approval process didn't show your message about trying to create a parser extension when I made my comment. Only your initial post and the one from dnehoda.
Okay so, you're sharing two different log sources in your examples. One is sequence ID 14 and the other is sequence ID 2433. Lets try to clear that up.
There's certain considerations when you build an extension. Also, you need to understand how that data is being sent over to SecOps. In this specific case, and potentially in all Cisco Router/switch logging, its sending via syslog or syslog/kv. I don't know just guessing here - but it seems maybe you are sending this to an intermediary syslog server and its chopping up the log somehow. maybe not.
Regardless though and this is a process that isn't typically handled well through messaging but:
Identify each field that you require to be parsed out - what else are you trying to get out of that log? There's not much there. Assuming you want the IP Address.
Second you need to create a grok statement to get that properly formatted and brought out within the parser to UDM.
There's examples here:
https://cloud.google.com/chronicle/docs/event-processing/using-parser-extensions
Hi @JuLenny
I stumbled upon your post to find the grok syntax you were looking for , I had something similar built up for cisco switch.. made changes as per your need posting it here..
If you have logs with different stanza's you can always add multiple grok patterns.