- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to concatenate a string with a variable?
I want to run this search but i have to concatenate the string with a variable and it doesn't work
| rest splunk_server=local /servicesNS/-/-/saved/searches
| where match(search,"outputlookup\s.$lookup$")
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content


I showed you how to do that this morning.
If this reply helps you, Karma would be appreciated.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The $lookup$ variable is a token from the dashboard drilldown
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Based on the comments in your original post - (try not to create multiple posts with different info, it makes it hard for people to help) - I understand you have a token that has multiple values.
If that $lookup$ token is created through a <set token="lookup"> statement in the drilldown and the original field is MV, then the token will concatenate those values and look like
a,b,c,d
so to do the match you would have to to something like (untested)
| rest splunk_server=local /servicesNS/-/-/saved/searches
| eval lookups="(".replace($lookup$, ",", "\|").")"
| where match(search,"outputlookup\s".lookups)
which effectively is turning a,b,c,d into (a|b|c|d) and then the match will be doing
| where match(search,"outputlookup\s(a|b|c|d)")
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This doesn't seem to work and the field is not a MV
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Pro tip (to get help from volunteers): Describe/illustrate your data (anonymize as needed but explain any characteristics others need to know) and desired output; describe the logic connecting your data and desired results (short, simple sample code/pseudo code is fine); if you have tried sample code, illustrate output and explain why it differs from desired results.
From the OP to this, there is only one piece of sample code and an explanation that the token in the sample is not itself multivalued. Unless you provide the rest of information, "it doesn't work" conveys absolutely no information. In fact, avoid this phrase like a plague even at the best of times.
