Splunk Search

Construct map command query in eval statement

drewg33
Engager

I am having trouble constructing a search command in an Eval statement. I stripped it down to its most basic form to troubleshoot, but I still can't get that to work.

| makeresults 
| eval test = "search earliest=1576263600 latest=1576512000 index=security sourcetype=host_info | head 10" 
| map search="$test$"

I also tried this which was recommended in a different splunk answers post, but that still didn't work for me on Splunk version 7.1.6.

| makeresults 
| eval test = "earliest=1576263600 latest=1576512000 index=security sourcetype=host_info | head 10" 
| map search="search [| makeresults | eval evaltest=$test$ | return $evaltest]"
0 Karma

Anantha123
Communicator

try giving double $ sign . passed variables should be in $$ sign.

| map search="search [| makeresults | eval evaltest="$$test$$" | return $evaltest]"

Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...