Splunk Search

Another regex question

jclehmuth
Path Finder

My current Regex is:

Retina: (?P'<'vuln'>\w+\s+\w+\s+\w+\s+\w+\s+\w+\s+\w+\s+\w+\s+\w+\s+\w+\s+\w+\s+\w+\s+\w+\s+)\"on IP"$>
There are slashes in between the s's and w's but I can't figure that out either right now.

I'm trying to extract results similar to "Retina has found High Severity audit Microsoft Windows Authenticode Verification Code Execution (2653956)" from the following type of logs, but I only get a few results.

Nov 10 00:19:39 10.0.33.210 2014-11-10 5:19:25 Retina: Retina has found High Severity audit Microsoft Windows Authenticode Verification Code Execution (2653956) on ip 10.0.33.198.
Nov 10 00:19:47 10.0.33.210 2014-11-10 5:19:33 Retina: Retina has found Medium Severity audit Microsoft Windows Kernel Privilege Escalation (2711167) on ip 10.0.33.198.
Nov 10 00:19:41 10.0.33.210 2014-11-10 5:19:27 Retina: Retina has found High Severity audit Microsoft .NET Framework Remote Code Execution (2878890) - KB2863240 on ip 10.0.33.198.
Nov 10 00:19:30 10.0.33.210 2014-11-10 5:19:16 Retina: Retina has found Low Severity audit Microsoft VBScript/JScript Information Disclosure (2475792) - VBScript on ip 10.0.33.198.
Nov 10 00:19:48 10.0.33.210 2014-11-10 5:19:34 Retina: Retina has found Informational audit DNP3 Protocol Detected on ip 10.0.33.198.

Thanks in advance.

Tags (1)
0 Karma
1 Solution

aljohnson_splun
Splunk Employee
Splunk Employee

Here I've copied your logs and tested out a regex that you could use. All you need to add is the field name.

Here's the example:
http://regexr.com/39sji

So your regex will look something like this:

 Retina: (?<vuln>.+?\(\d+\)

The thing you need to do add the +? which makes the regex non-greedy, it matches the least rather than the most. Then you just go to the end of the next group of digits that are also surrounded by parenthesis.

View solution in original post

aljohnson_splun
Splunk Employee
Splunk Employee

Here I've copied your logs and tested out a regex that you could use. All you need to add is the field name.

Here's the example:
http://regexr.com/39sji

So your regex will look something like this:

 Retina: (?<vuln>.+?\(\d+\)

The thing you need to do add the +? which makes the regex non-greedy, it matches the least rather than the most. Then you just go to the end of the next group of digits that are also surrounded by parenthesis.

jclehmuth
Path Finder

That seemed to work, thanks.

0 Karma

rkent
Explorer

While this works, if we allow a tiny bit of pedantry, I'd revise this regex to:

Retina: (?

0 Karma

jclehmuth
Path Finder

I can get it to partly work when I replace the "+" with "*"

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Monitoring AI Agents with Splunk Observability Cloud

Let’s say I’m running a travel planning AI app in production. A user asks for three concise hotel options in ...

[Puzzles] Solve, Learn, Repeat: Tiling

This puzzle (first published here) is based on finding groups of tessellated tiles (inspired by floor tiles I ...

SOK it to Me: Top 3 Benefits of Using Splunk Operator on Kubernetes that’ll Make ...

    Thursday, July 9, 2026  |  11:00AM–12:00PM PDT Duration: 1 hour (includes Q&A) Managing can feel like a ...