Splunk Search

Search using variables

lakromani
Builder

This should be trivial to do, but I am not able to search using variables.

Eks this works
some splunk data | search direction="out"

But this does not:
some splunk data | eval test="out" | search direction="$test$"
nor this:
some splunk data | eval test="out" | search direction=$test$

What do I do wrong. Search google, but did not find and working solution.

0 Karma
1 Solution

somesoni2
Revered Legend

What is the requirement here? From where this variable should come from? If it's a field from same search, you can use like this

some splunk data | eval test="out" | where direction=test

View solution in original post

somesoni2
Revered Legend

What is the requirement here? From where this variable should come from? If it's a field from same search, you can use like this

some splunk data | eval test="out" | where direction=test

lakromani
Builder

That did do it. Data is coming from a drop down input on a dashboard.
If you post it as an answer I can accept it 🙂

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

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 GA in US-AWS!

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