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!

Application management with Targeted Application Install for Victoria Experience

  Experience a new era of flexibility in managing your Splunk Cloud Platform apps! With Targeted Application ...

Index This | What goes up and never comes down?

January 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Splunkers, Pack Your Bags: Why Cisco Live EMEA is Your Next Big Destination

The Power of Two: Splunk + Cisco at "Ludicrous Scale"   You know Splunk. You know Cisco. But have you seen ...