Splunk Search

Field Extraction - Parsing - Regex

abhijitnayak
New Member

Hi Everyone,

I am trying to extract fields from the multivalued Field which has the following

http://pubads.g.doubleclick.net/gampad/ads?correlator=1329033559899&output=json_html&callback=GA_goo...

The parameters are usually separated by param="Value"

From the above text = GA_googleSetAdContentsBySlotForSync

Parameter = &callback
value = GA_googleSetAdContentsBySlotForSync

Parameter = &flash
value = 10.3.181.34

The text above is one field and this parameter extraction has to be done only to websites which are search engines ..

Is there a way to extract the field values even if it is not dynamic way of extraction?

0 Karma

abhijitnayak
New Member

GOT IT!!!
source="POC.txt" | regex Field2="google" | makemv delim="&" Field2

0 Karma

mikelanghorst
Motivator

Did you look at all the fields, not just those shown on the left? Click Edit, and in the pop-up window that field should already be extracted as "correlator".

Splunk should automatically extract a value any time it sees a key=value. How it determines what are "interesting fields" I'm not sure.

0 Karma

abhijitnayak
New Member

Hi Mike , I dont this its so easy .
We would have to parse and cut the words between &param1="WORD"&param2
Let me know if there is a way to do this.

0 Karma

abhijitnayak
New Member

Field2 that needs to be extracted is 1329033560.. can you please suggest the regex to derive this multi valued field?

0 Karma

abhijitnayak
New Member

I am new to splunk. Can you please tell how to achieve this? I am unable to find the search query using splunk

| eval Field2=substr(message, charindex(message, "&lmt="), charindex(message, "&dt="))

I have used some thing as above but charindex doesnt work.

here "message" is the Field which is been extracted during the data import.

0 Karma

Ayn
Legend

I don't understand what's not working and how you would like things to work. Could you state your problem more clearly please?

Get Updates on the Splunk Community!

Unlock Database Monitoring with Splunk Observability Cloud

  In today’s fast-paced digital landscape, even minor database slowdowns can disrupt user experiences and ...

Purpose in Action: How Splunk Is Helping Power an Inclusive Future for All

At Cisco, purpose isn’t a tagline—it’s a commitment. Cisco’s FY25 Purpose Report outlines how the company is ...

[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 ...