Splunk Search

Comparing 2 fields

xvxt006
Contributor

Hi,

I have 2 fields that are already extracted uri and referer. I want to right a search based on if
uri value =referer value. I guess i have to use eval. Can you please give me syntax?

Tags (1)
0 Karma

kristian_kolb
Ultra Champion
... | where uri==referer | ...

/K

gfuente
Motivator

Hello

Probably you need to remove the domain part from the referrer field, as the uri doesn't include that part. Lets say:
uri: /example/page.html
referrer: http://www.example.com/example/page.html

Regards

0 Karma

Ayn
Legend

That happens if uri is never equal to referer. Check your fields.

0 Karma

xvxt006
Contributor

Actually i tried this but did not work. i am getting no results.

0 Karma

Ayn
Legend
| eval yourfield=if(uri==referer,...

Ayn
Legend

Oh! No, very much incorrect. Early morning - correcting.

0 Karma

kristian_kolb
Ultra Champion

Is that correct? Normally eval is an assignment of a value to a field.

0 Karma
Get Updates on the Splunk Community!

Splunk MCP & Agentic AI: Machine Data Without Limits

  Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization ...

Finding Based Detections General Availability

Overview  We’ve come a long way, folks, but here in Enterprise Security 8.4 I’m happy to announce Finding ...

Get Your Hands Dirty (and Your Shoes Comfy): The Splunk Experience

Hands-On Learning and Technical Seminars  Sometimes, you just need to see the code. For those looking for a ...