Splunk Search

Variable in eval for URL

bdfurman
New Member

I'm sure this is fairly simple to do, just can't seem to find the right way to do this.

Let's say that I have a search string that returns multiple fields. Of those fields, we have:
foo: 100
bar: 200

Now I want to add an eval so that it will show "http://google.com/100/200". Essentially, I'm trying to tell it to do "http://google.com/$foo/$bar". http://google.com is nowhere in my search results, I am statically defining that.

How can i do that via eval? I would think I can do something like the following, but it doesnt seem to work.

| eval url=http://google.com/"$foo$"/"$bar"/
| table url
Tags (1)
0 Karma
1 Solution

somesoni2
Revered Legend

Try like this (dot as concatenation operator, fields can be referred directory by name)

your current search | eval url="http://www.google.com/".foo."/".bar."/"

View solution in original post

somesoni2
Revered Legend

Try like this (dot as concatenation operator, fields can be referred directory by name)

your current search | eval url="http://www.google.com/".foo."/".bar."/"

richgalloway
SplunkTrust
SplunkTrust

Try ... | eval url="http://google.com/".foo."/".bar | ....

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...