<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to run a parameterized map command as a savedsearch report? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-run-a-parameterized-map-command-as-a-savedsearch-report/m-p/418440#M120315</link>
    <description>&lt;P&gt;Just had the very same problem and spent far too long trying to solve it. If you write test like this: &lt;CODE&gt;$test$&lt;/CODE&gt; then splunk interprets this as expecting an input variable of test. To resolve this it looks like you have to use double dollar signs:&lt;BR /&gt;
&lt;CODE&gt;| makeresults count=1 | eval test="Hello" | map search="| makeresults count=1 | eval test=$$test$$"&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 14 Jan 2020 12:29:53 GMT</pubDate>
    <dc:creator>ammara</dc:creator>
    <dc:date>2020-01-14T12:29:53Z</dc:date>
    <item>
      <title>How to run a parameterized map command as a savedsearch report?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-run-a-parameterized-map-command-as-a-savedsearch-report/m-p/418439#M120314</link>
      <description>&lt;P&gt;Hi everyone, &lt;/P&gt;

&lt;P&gt;I have the following dummy search saved as a report:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| makeresults count=1 | eval test="Hello" | map search="| makeresults count=1 | eval test=\"$test$\""&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Executing this search directly runs without issues. However when calling it using the savedsearch-command:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| savedsearch TestReport&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I get the following error message:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Error in 'savedsearch' command: Encountered the following error while building a search for saved search 'TestReport': Error while replacing variable name='test'. Could not find variable in the argument map.&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I'm running Splunk 7.1.1 on a standalone machine. Does someone has a clue why it can be executed manually but not as a report and how I could execute it as a report?&lt;/P&gt;

&lt;P&gt;Kind regards,&lt;BR /&gt;
Bojan&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2019 07:39:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-run-a-parameterized-map-command-as-a-savedsearch-report/m-p/418439#M120314</guid>
      <dc:creator>bojanjanisch</dc:creator>
      <dc:date>2019-03-01T07:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to run a parameterized map command as a savedsearch report?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-run-a-parameterized-map-command-as-a-savedsearch-report/m-p/418440#M120315</link>
      <description>&lt;P&gt;Just had the very same problem and spent far too long trying to solve it. If you write test like this: &lt;CODE&gt;$test$&lt;/CODE&gt; then splunk interprets this as expecting an input variable of test. To resolve this it looks like you have to use double dollar signs:&lt;BR /&gt;
&lt;CODE&gt;| makeresults count=1 | eval test="Hello" | map search="| makeresults count=1 | eval test=$$test$$"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jan 2020 12:29:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-run-a-parameterized-map-command-as-a-savedsearch-report/m-p/418440#M120315</guid>
      <dc:creator>ammara</dc:creator>
      <dc:date>2020-01-14T12:29:53Z</dc:date>
    </item>
  </channel>
</rss>

