Splunk Search

Extract IP address from event log

seba333
Engager

Hi!

Need help with this please.

I have to extract the IP address from this:

src=45.141.87.33:53402:X19

value 53402 and value X19 could be anything.

 

help please!

 

Labels (1)

inventsekar
SplunkTrust
SplunkTrust

EDIT- verified, working good.


assuming you want to extract "45.141.87.33"

 

 

| makeresults 
| eval log = "test src=45.141.87.33:53402:X19 test" 
| rex field=log "(?<ipAddr>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})" | table ipAddr log

 

rex-ip-new.png

 

thanks and best regards,
Sekar

PS - If this or any post helped you in any way, pls consider upvoting, thanks for reading !
Tags (2)
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...