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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...