All Apps and Add-ons

Field extraction

kaw243
Explorer

Below is an example from an access.log that I am trying to extract the productList from. The number of products numbers change for each request. i.e. some may have 1 product number some may have 5. I need some help in extracting the productList separately.

2013-12-31 12:30:53 0.0010 0 - 204.107.141.40 GET /open-sounthing/compete.html?pagename=myco:getsomething:page7:goodjob&differentinfo=someinfo&productList=4004,4102,4107 200

I would like to be able to pull out the productList and rename them by number to use in pivot
4004= corn
4102= viper
4107= dog

0 Karma
1 Solution

martin_mueller
SplunkTrust
SplunkTrust

This would get you a multivalue field with the three productIds:

... | rex "productList=(?<productId>(\d+,?)+)" | makemv productId delim=","

View solution in original post

martin_mueller
SplunkTrust
SplunkTrust

This would get you a multivalue field with the three productIds:

... | rex "productList=(?<productId>(\d+,?)+)" | makemv productId delim=","

somesoni2
Revered Legend

Then you can have lookup file containing productId and productionName and do a lookup to get productName into your result.

...@martin's search | lookup productiondetail.csv productId OUTPUT productName

kaw243
Explorer

Thanks that worked

0 Karma
Get Updates on the Splunk Community!

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...