Getting Data In

How to write rex to extract multiple Ips?

nivets
Engager

I am trying to extract Ips from the field called Text, where this field contains Ips & some string values ,  this field not contains only one IP all time, it may contain 2 Ips , 3 or 5 or more than that.  Ips will not be same for all the events and the string "value" is same for all the events

eg.,

Text= value 127.0.0.1,10.x.x.x, 10.x.x.1,10.x.x.3

Text= value 145.X.X.2, 19.x.x.3

Text= value 123.X.X.X

So, i need to extract only ip separetely(irrespective of count of Ips) and "value" in one field.

0 Karma
1 Solution

PaulPanther
Motivator

Try 

 

|rex field=Text max_match=0 "(?<ip_address>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})"

 

 

View solution in original post

0 Karma

PaulPanther
Motivator

Try 

 

|rex field=Text max_match=0 "(?<ip_address>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})"

 

 

0 Karma
Get Updates on the Splunk Community!

[Upcoming Webinar] Demo Day: Transforming IT Operations with Splunk

Join us for a live Demo Day at the Cisco Store on January 21st 10:00am - 11:00am PST In the fast-paced world ...

New Year. New Skills. New Course Releases from Splunk Education

A new year often inspires reflection—and reinvention. Whether your goals include strengthening your security ...

Splunk and TLS: It doesn't have to be too hard

Overview Creating a TLS cert for Splunk usage is pretty much standard openssl.  To make life better, use an ...