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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...