<?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 can I use a variable as parameter for a custom command? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-a-variable-as-parameter-for-a-custom-command/m-p/153302#M43014</link>
    <description>&lt;P&gt;Try this @spammenot66 and @HustenHelmut334.&lt;/P&gt;</description>
    <pubDate>Thu, 18 Apr 2019 12:39:25 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-04-18T12:39:25Z</dc:date>
    <item>
      <title>How can I use a variable as parameter for a custom command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-a-variable-as-parameter-for-a-custom-command/m-p/153300#M43012</link>
      <description>&lt;P&gt;This is not working: Is there a special syntax to use the content of a variable an not its name?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="test"
|stats
|eval minute=tonumber(strftime(_time,"%M"))
|eval foo=250
|eval th=if(minute &amp;gt; 30,"foo=100:200","foo=0:0")
|addinfo
|mycustomcommand monitor=test defaults="foo=150" thresholds=th
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This working:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|mycustomcommand monitor=test defaults="foo=150" thresholds="foo=100:200"    
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Why is th not evaluated?&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2015 15:12:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-a-variable-as-parameter-for-a-custom-command/m-p/153300#M43012</guid>
      <dc:creator>HustenHelmut334</dc:creator>
      <dc:date>2015-02-17T15:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use a variable as parameter for a custom command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-a-variable-as-parameter-for-a-custom-command/m-p/153301#M43013</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="test"
|stats
|eval minute=tonumber(strftime(_time,"%M"))
|eval foo="250"
|eval th=if(minute &amp;gt; 30,"foo=100:200","foo=0:0")
|addinfo
| map search="|mycustomcommand monitor=test defaults=\"foo=$foo$\" thresholds=\"$th$\""
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 Apr 2019 12:38:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-a-variable-as-parameter-for-a-custom-command/m-p/153301#M43013</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-04-18T12:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use a variable as parameter for a custom command?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-a-variable-as-parameter-for-a-custom-command/m-p/153302#M43014</link>
      <description>&lt;P&gt;Try this @spammenot66 and @HustenHelmut334.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2019 12:39:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-a-variable-as-parameter-for-a-custom-command/m-p/153302#M43014</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-04-18T12:39:25Z</dc:date>
    </item>
  </channel>
</rss>

