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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...

Updated Data Management and AWS GDI Inventory in Splunk Observability

We’re making some changes to Data Management and Infrastructure Inventory for AWS. The Data Management page, ...