<?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 Does splunk support parameterized queries in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Does-splunk-support-parameterized-queries/m-p/105965#M27537</link>
    <description>&lt;P&gt;I am curious if parametrized queries are possible within within splunk dashboards or searches:&lt;/P&gt;

&lt;P&gt;ex.
query: foo=bar AND env=${VARIABLE}&lt;/P&gt;

&lt;P&gt;I would then like to be able to define VARIABLE at a higher level or perhaps even have a preamble in the query such as: SET VARIABLE=prod : foo=bar AND env=${VARIABLE}.&lt;/P&gt;

&lt;P&gt;This appears to be a similar question: &lt;A href="http://answers.splunk.com/questions/6138/pass-parameters-to-dashboard-form" rel="nofollow"&gt;link text&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Fri, 17 Dec 2010 01:16:10 GMT</pubDate>
    <dc:creator>gregbujak</dc:creator>
    <dc:date>2010-12-17T01:16:10Z</dc:date>
    <item>
      <title>Does splunk support parameterized queries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-splunk-support-parameterized-queries/m-p/105965#M27537</link>
      <description>&lt;P&gt;I am curious if parametrized queries are possible within within splunk dashboards or searches:&lt;/P&gt;

&lt;P&gt;ex.
query: foo=bar AND env=${VARIABLE}&lt;/P&gt;

&lt;P&gt;I would then like to be able to define VARIABLE at a higher level or perhaps even have a preamble in the query such as: SET VARIABLE=prod : foo=bar AND env=${VARIABLE}.&lt;/P&gt;

&lt;P&gt;This appears to be a similar question: &lt;A href="http://answers.splunk.com/questions/6138/pass-parameters-to-dashboard-form" rel="nofollow"&gt;link text&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2010 01:16:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-splunk-support-parameterized-queries/m-p/105965#M27537</guid>
      <dc:creator>gregbujak</dc:creator>
      <dc:date>2010-12-17T01:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: Does splunk support parameterized queries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-splunk-support-parameterized-queries/m-p/105966#M27538</link>
      <description>&lt;P&gt;Use the form dashboard or the pulldown dashboard, here would be an example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form class="formsearch"&amp;gt;
       &amp;lt;label&amp;gt;Test Form&amp;lt;/label&amp;gt;
       &amp;lt;fieldset&amp;gt;
              &amp;lt;input type="dropdown" token="breakdown" searchWhenChanged="true"&amp;gt;
                       &amp;lt;label&amp;gt;Breakdown&amp;lt;/label&amp;gt;
                       &amp;lt;choice value="QHour"&amp;gt;Quarter Hour&amp;lt;/choice&amp;gt;
                       &amp;lt;choice value="Hour"&amp;gt;Hour&amp;lt;/choice&amp;gt;
              &amp;lt;/input&amp;gt;
       &amp;lt;/fieldset&amp;gt;

       &amp;lt;row&amp;gt;
              &amp;lt;chart&amp;gt;
                     &amp;lt;searchString&amp;gt;index=main $breakdown$ &amp;lt;/searchString&amp;gt;
                     &amp;lt;title&amp;gt;Blah&amp;lt;/title&amp;gt;
              &amp;lt;/chart&amp;gt;
       &amp;lt;/row&amp;gt;
  &amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So the FieldSet block builds a drop down menu and sets the variable "breakdown" to what ever the user selects, then passes that variable to a chart. &lt;/P&gt;

&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2010 18:11:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-splunk-support-parameterized-queries/m-p/105966#M27538</guid>
      <dc:creator>bbingham</dc:creator>
      <dc:date>2010-12-17T18:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: Does splunk support parameterized queries</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-splunk-support-parameterized-queries/m-p/105967#M27539</link>
      <description>&lt;P&gt;Thanks, that looks like a good place to start.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2010 23:23:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-splunk-support-parameterized-queries/m-p/105967#M27539</guid>
      <dc:creator>gregbujak</dc:creator>
      <dc:date>2010-12-17T23:23:14Z</dc:date>
    </item>
  </channel>
</rss>

