Splunk Search

Need to pull IP from Message field

radalliance
Engager

Hey all, I'm trying to separate out the IP address (Source Network Address:) from the Windows event Message field. I'm trying to find every instance of authentication for a certain user acct (including services & IIS app pools), but I'm having to parse it from the logs I'm getting from our Domain controllers.

I'm pretty new to Splunk so my search is fairly basic. This is all I have so far, and I haven't been able to find info on whether that rex field should equal the new field I'm trying to create, or the field I'm searching, or what:

index=* user=username EventCode=4740 OR EventCode=4648 OR EventCode=4672 OR EventCode=4624 | rex field=ServerIP "Source Network Address:(?<Message>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})"

So what I'm trying to do:

Search Windows event log "Message" field > Find string "Source Network Address:ipaddress"

Create new field with Value being above IP address

 

Appreciate any help!

 

Labels (2)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @radalliance,

are you sure that you already haven't that field? I have in my logs with the field name "IpAddress"

Anyway, with this regex I'm able to extract it:

| rex "(?<IP>\d+\.\d+\.\d+\.\d+)"

Ciao.

Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @radalliance,

are you sure that you already haven't that field? I have in my logs with the field name "IpAddress"

Anyway, with this regex I'm able to extract it:

| rex "(?<IP>\d+\.\d+\.\d+\.\d+)"

Ciao.

Giuseppe

radalliance
Engager

Perfect, thank you. Removed the extra eventID search and was able to return just what I needed with the following:

index=* user=username | rex "(?<IP>\d+\.\d+\.\d+\.\d+)" | stats count by IP | lookup dnslookup clientip as IP OUTPUT clienthost as host | sort - count | table IP, host, count | fields "IP", "host", "count"

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @radalliance,

good for you, see next time.

Ciao and happy splunking.

Giuseppe.

P.S.: Karma Points are appreciated 😉

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!

Laser Bananas and Edge Hubs: Exploring Operational Technology (OT) Data Through a ...

  OT is a different environment to traditional IT and can have interesting challenges when interfacing the ...

Event Series: Mastering AI Tokenomics and Splunk Agent Observability

Beyond the Black Box: Correlating AI Performance and Tokenomics with Splunk Agent Observability   As ...

span_metrics: The OpenTelemetry-Idiomatic Way to See Inside Your Services

You open a trace in Splunk Observability Cloud and everything looks fine. One root span, order-pipeline, with ...