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
SplunkTrust
SplunkTrust

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
SplunkTrust
SplunkTrust

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!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...