Splunk Search

Eval part of http url

surendrarhi
New Member

I want to identify the which page each user visited from the URL

"//xxxxx.com/003/o" as Home Page
"//xxxxx.com/003" as List Page
"//xxxxx.com/003XXXXXXXXXXXX" - Edit Page -- here it starts with 003 and length is 15 characters.

I tried using eval
eval description=case(match(url,"/003"),"List Page", match(url,"/003/0"),"Home Page")

but it always displays List Page, need some help

Tags (2)
0 Karma

somesoni2
Revered Legend

Try this

your base search giving field url| eval description=case(match(url,"/003/0"),"Home Page", match(url,"/003[a-zA-Z0-9]{12}"),"List Page", 1=1,"Edit Page")
0 Karma

surendrarhi
New Member

eval description=case(match(url,"/001/o"),"Home View", match(url,"/001[a-zA-Z0-9]{12}"),"List View",1=1,"Edit View")

It always displaying "List View"

0 Karma

somesoni2
Revered Legend

For Home page its "/003/0" or "/003/o"? the X's in Edit Page are numbers or alphabets?

0 Karma
Get Updates on the Splunk Community!

Technical Workshop Series: Splunk Data Management and SPL2 | Register here!

Hey, Splunk Community! Ready to take your data management skills to the next level? Join us for a 3-part ...

Spotting Financial Fraud in the Haystack: A Guide to Behavioral Analytics with Splunk

In today's digital financial ecosystem, security teams face an unprecedented challenge. The sheer volume of ...

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability As businesses scale ...