<?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: Based on user input, add conditionals to both base-query and regular query of a dashboard in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Based-on-user-input-how-to-add-conditionals-to-both-base-query/m-p/654955#M226246</link>
    <description>&lt;P&gt;Your dropdown sets a token to a string. This string is substituted into your searches whenever it is mentioned.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;search id="base_query"&amp;gt;
&amp;lt;query&amp;gt;index=logs sourcetype=ci "Shipping Finished" $token$ ...&amp;lt;/query&amp;gt;

&amp;lt;search base="base_query"&amp;gt;
&amp;lt;query&amp;gt; | join some_field [ search index=logs sourcetype=ci | search $token$ AND "Received complete status"&lt;/LI-CODE&gt;</description>
    <pubDate>Sat, 19 Aug 2023 08:02:56 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2023-08-19T08:02:56Z</dc:date>
    <item>
      <title>Based on user input, how to add conditionals to both base-query and regular query of a dashboard?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Based-on-user-input-how-to-add-conditionals-to-both-base-query/m-p/654954#M226245</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Splunk dashboard: We have a dropdown with 2 possible values, option1 and option2.&lt;BR /&gt;Based on what user selects, (&lt;BR /&gt;option1: "A" or "B" ) gets added to both base-query and query OR&amp;nbsp;&lt;BR /&gt;option2: ("X" or "Y") gets added to both base-query and query.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1. If user selects "option1", query is &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;lt;search id="base_query"&amp;gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;lt;query&amp;gt;index=logs sourcetype=ci "Shipping Finished" ("A" OR "B") ...&amp;lt;/query&amp;gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;lt;search base="base_query"&amp;gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;lt;query&amp;gt; | join some_field [ search index=logs sourcetype=ci | search ("A" OR "B") AND "Received complete status" &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2. If user selects "option2", query is:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;lt;search id="base_query"&amp;gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;lt;query&amp;gt;index=logs sourcetype=ci "Shipping Finished" ("X" OR "Y") ... &amp;lt;/query&amp;gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;lt;search base="base_query"&amp;gt; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;lt;query&amp;gt; | join some_field [ search index=logs sourcetype=ci | search ("X" OR "Y") AND "Received complete status"&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2023 19:44:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Based-on-user-input-how-to-add-conditionals-to-both-base-query/m-p/654954#M226245</guid>
      <dc:creator>sthaker</dc:creator>
      <dc:date>2023-08-21T19:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: Based on user input, add conditionals to both base-query and regular query of a dashboard</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Based-on-user-input-how-to-add-conditionals-to-both-base-query/m-p/654955#M226246</link>
      <description>&lt;P&gt;Your dropdown sets a token to a string. This string is substituted into your searches whenever it is mentioned.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;search id="base_query"&amp;gt;
&amp;lt;query&amp;gt;index=logs sourcetype=ci "Shipping Finished" $token$ ...&amp;lt;/query&amp;gt;

&amp;lt;search base="base_query"&amp;gt;
&amp;lt;query&amp;gt; | join some_field [ search index=logs sourcetype=ci | search $token$ AND "Received complete status"&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 19 Aug 2023 08:02:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Based-on-user-input-how-to-add-conditionals-to-both-base-query/m-p/654955#M226246</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-08-19T08:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: Based on user input, add conditionals to both base-query and regular query of a dashboard</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Based-on-user-input-how-to-add-conditionals-to-both-base-query/m-p/654959#M226248</link>
      <description>&lt;P&gt;Thanks ITWhisperer. This works. In the past I was adding () around my search strings due to which it didn't work.&lt;BR /&gt;&lt;BR /&gt;Here's the correct way to define input dropdown, I added values as follows:&lt;/P&gt;&lt;P&gt;&amp;lt;input type="dropdown" token="ip_family" searchWhenChanged="true"&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;IP Family&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;choice value="&amp;amp;quot;Foo&amp;amp;quot; OR&amp;nbsp;&amp;amp;quot;Bar&amp;amp;quot;"&amp;gt;option1&amp;lt;/choice&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;choice value="&amp;amp;quot;Boo&amp;amp;quot; OR&amp;nbsp;&amp;amp;quot;Baz&amp;amp;quot;"&amp;gt;option2&amp;lt;/choice&amp;gt;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Aug 2023 14:30:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Based-on-user-input-how-to-add-conditionals-to-both-base-query/m-p/654959#M226248</guid>
      <dc:creator>sthaker</dc:creator>
      <dc:date>2023-08-19T14:30:51Z</dc:date>
    </item>
  </channel>
</rss>

