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

 

Tags (2)
0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...