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!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...