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!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...