<?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 Having trouble passing values in a macro to collect command. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Having-trouble-passing-values-in-a-macro-to-collect-command/m-p/510279#M142796</link>
    <description>&lt;P&gt;Splunkers,&lt;/P&gt;&lt;P&gt;I sure hope this is just user error and I am myopic today!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a simple macro:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;collectevents(2)
args=index_parm,testmode_parm
| addinfo | collect index=$index_parm$ testmode=$testmode_parm$ source=mysource &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These both work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;`collectevents("Indexname",0)`
`collectecents("Indexname","False")`&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But these don't work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;stuff....
|eval index_parm="Indexname"
|eval testmode_parm=0
`collectevents(index_parm,testmode_parm)`&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;When ever I pass a variable I get:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error in 'SearchProcessor': Invalid option value. Expecting a 'boolean' for option 'testmode'.&amp;nbsp; Instead got 'testmode_parm'.&lt;/P&gt;&lt;P&gt;It only complains about the testmode, but it's not passing the index_parm string correctly either. &amp;nbsp; If I don't pass or remove testmode_parm, I stop getting an error but nothing shows up in the index.&amp;nbsp; Crtl+Shift+E show index=index_parm.&amp;nbsp; It's like the substitution is just not taking place.&lt;/P&gt;&lt;P&gt;Any ideas?&amp;nbsp; Thank you.&lt;/P&gt;</description>
    <pubDate>Tue, 21 Jul 2020 19:35:55 GMT</pubDate>
    <dc:creator>ddelmont</dc:creator>
    <dc:date>2020-07-21T19:35:55Z</dc:date>
    <item>
      <title>Having trouble passing values in a macro to collect command.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Having-trouble-passing-values-in-a-macro-to-collect-command/m-p/510279#M142796</link>
      <description>&lt;P&gt;Splunkers,&lt;/P&gt;&lt;P&gt;I sure hope this is just user error and I am myopic today!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a simple macro:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;collectevents(2)
args=index_parm,testmode_parm
| addinfo | collect index=$index_parm$ testmode=$testmode_parm$ source=mysource &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These both work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;`collectevents("Indexname",0)`
`collectecents("Indexname","False")`&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But these don't work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;stuff....
|eval index_parm="Indexname"
|eval testmode_parm=0
`collectevents(index_parm,testmode_parm)`&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;When ever I pass a variable I get:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error in 'SearchProcessor': Invalid option value. Expecting a 'boolean' for option 'testmode'.&amp;nbsp; Instead got 'testmode_parm'.&lt;/P&gt;&lt;P&gt;It only complains about the testmode, but it's not passing the index_parm string correctly either. &amp;nbsp; If I don't pass or remove testmode_parm, I stop getting an error but nothing shows up in the index.&amp;nbsp; Crtl+Shift+E show index=index_parm.&amp;nbsp; It's like the substitution is just not taking place.&lt;/P&gt;&lt;P&gt;Any ideas?&amp;nbsp; Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2020 19:35:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Having-trouble-passing-values-in-a-macro-to-collect-command/m-p/510279#M142796</guid>
      <dc:creator>ddelmont</dc:creator>
      <dc:date>2020-07-21T19:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: Having trouble passing values in a macro to collect command.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Having-trouble-passing-values-in-a-macro-to-collect-command/m-p/510298#M142806</link>
      <description>&lt;P&gt;&lt;STRONG&gt;0&amp;nbsp;&lt;/STRONG&gt;is string or number in this case, I guess.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2020 21:22:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Having-trouble-passing-values-in-a-macro-to-collect-command/m-p/510298#M142806</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-07-21T21:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: Having trouble passing values in a macro to collect command.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Having-trouble-passing-values-in-a-macro-to-collect-command/m-p/510299#M142807</link>
      <description>&lt;P&gt;Thank you Murphy.&amp;nbsp; Should have posted this sooner.&amp;nbsp; Found a solution at:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Knowledge-Management/collect-index-quot-based-on-values-quot/td-p/473593" target="_self"&gt;https://community.splunk.com/t5/Knowledge-Management/collect-index-quot-based-on-values-quot/td-p/473593&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2020 21:23:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Having-trouble-passing-values-in-a-macro-to-collect-command/m-p/510299#M142807</guid>
      <dc:creator>ddelmont</dc:creator>
      <dc:date>2020-07-21T21:23:38Z</dc:date>
    </item>
  </channel>
</rss>

