Splunk Search

Help with Rex or RegEx - Need Everything After a String

aferone
Builder

Here is an example of a VPN log with an error. I want to create a field for "Reason", which includes everything found after "Reason:", until the end of the line:

2014-02-26 11:26:05 -05:00 @vpn1 id=firewall time="2014-02-26 11:26:05" pri=6 fw=X.X.X.X vpn=vpn1 user=XXX realm="XXXX" roles="XXXXX" proto=auth src=X.X.X.X dst= dstname= type=vpn op= arg="" result= sent= rcvd= agent="" duration= msg="AUT22925: Host Checker policy 'Comp Configuration Check' failed on host X.X.X.X  for user 'XXX'. Reason: 'Registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\XXX\not found; Registry key: HKEY_LOCAL_MACHINE\XXX\Plan not found; Registry key: HKEY_LOCAL_MACHINE\Wow6432Node\XXX\Plan not found; Registry key: HKEY_LOCAL_MACHINE\XXX\Plan  not found; Registry key: HKEY_LOCAL_MACHINE\Wow6432Node\XXX\Plan not found; Registry key: HKEY_LOCAL_MACHINE\XXX\Plan not found'."

Thanks!

Tags (2)
0 Karma
1 Solution

somesoni2
SplunkTrust
SplunkTrust

Try this

your base search | rex "Reason:(?<Reason>.*)"

View solution in original post

somesoni2
SplunkTrust
SplunkTrust

Try this

your base search | rex "Reason:(?<Reason>.*)"

aferone
Builder

Nailed it! Thank you!

Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...