Splunk Search

How to write a search to extract an IP address after a line within a Windows security event?

pyi
Engager

Hello, I have the following:

11/20/2014 11:04:58 AM
LogName=Security
SourceName=AD FS 2.0 Auditing
EventCode=501
.
.
.
http://schemas.microsoft.com/2012/01/requestcontext/claims/x-ms-forwarded-client-ip
1.1.1.1
.
.
.
.

How can I construct a query to get the IP address in the result ? I am looking for a way to get data in the line after http://schemas.microsoft.com/2012/01/requestcontext/claims/x-ms-forwarded-client-ip

0 Karma

musskopf
Builder

Use a Regex, like that:

index=bla "something to search" | rex field=_raw "x-ms-forwarded-client-ip (?P<clientIP>(\d{1,3}\.){3}\d{1,3})"

Now you can see that a new field, named clientIP, will be available for you.

Cheers,

0 Karma
Get Updates on the Splunk Community!

Brains, Bytes, and Boston: Learn from the Best at .conf25

When you think of Boston, you might picture colonial charm, world-class universities, or even the crack of a ...

Splunk AppDynamics Agents Webinar Series

Mark your calendars! On June 24th at 12PM PST, we’re going live with the second session of our Splunk ...

SplunkTrust Application Period is Officially OPEN!

It's that time, folks! The application/nomination period for the 2025 SplunkTrust is officially open! If you ...