<?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: Using Multiselect values in where clause in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Using-Multiselect-values-in-where-clause/m-p/355800#M23183</link>
    <description>&lt;P&gt;I think you understood the question, but it doesn't look like this is working either. If I don't select a domain name in the multiselect and just use the default of *, the search returns results. However if I select one or more domain names, it doesn't return any results.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;label&amp;gt;DOMAIN NAME&amp;lt;/label&amp;gt;
  &amp;lt;fieldForLabel&amp;gt;DOMAIN_NAME&amp;lt;/fieldForLabel&amp;gt;
  &amp;lt;fieldForValue&amp;gt;DOMAIN_NAME&amp;lt;/fieldForValue&amp;gt;
  &amp;lt;prefix&amp;gt;(&amp;lt;/prefix&amp;gt;
  &amp;lt;suffix&amp;gt;)&amp;lt;/suffix&amp;gt;
  &amp;lt;delimiter&amp;gt;OR&amp;lt;/delimiter&amp;gt;
  &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
  &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there any way to see the value of $domain_name_dropdown$ that is being used in the search?  &lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 15:16:10 GMT</pubDate>
    <dc:creator>ChrisLa</dc:creator>
    <dc:date>2020-09-29T15:16:10Z</dc:date>
    <item>
      <title>Using Multiselect values in where clause</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Using-Multiselect-values-in-where-clause/m-p/355798#M23181</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'm creating a dashboard right now that uses a multiselect field to filter the data loaded into a table. The issue I'm having stems from the field I want to compare the multiselect values against. I'm pulling DOMAIN_NAME from the source field in the query, and I want to limit the results of the table to only logs that contain matching DOMAIN_NAMES values.&lt;/P&gt;

&lt;P&gt;Here is the query I'm using to populate the multiselect:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=hostnameindex="index" "BEA" | rex field=source "(?&amp;lt;LOG_DIRr&amp;gt;[\w\W/]+)/(?&amp;lt;DOMAIN_NAME&amp;gt;[^.]+)/(?&amp;lt;JVM_NAME&amp;gt;[^.]+)/(?&amp;lt;LOG_NAME&amp;gt;[^.]+).*" | dedup DOMAIN_NAME | stats count by DOMAIN_NAME
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And here is the query I'm using for the table:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=hostname index="index" "BEA" $domain_name_dropdown$ | rex field=source "(?&amp;amp;lt;LOG_DIRr&amp;amp;gt;[\w\W/]+)/(?&amp;amp;lt;DOMAIN_NAME&amp;amp;gt;[^.]+)/(?&amp;amp;lt;JVM_NAME&amp;amp;gt;[^.]+)/(?&amp;amp;lt;LOG_NAME&amp;amp;gt;[^.]+).*"  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I think this is because the DOMAIN_NAME values that I'm trying to search on haven't been captured yet in the search string.. So it's trying to search for DOMAIN_NAME in the logs (which is only in the source field) before doing the regex to actually pull the domain name out. &lt;/P&gt;

&lt;P&gt;To combat this I tried using a where clause after the regex. This works beautifully when I only select one value in the multiselect. However, I cannot find a way to use a single where clause with multiple values.. I even tried using the prefix/suffix/delimiter values in the multiselect to build a whole where clause for each value, but that doesn't work. &lt;/P&gt;

&lt;P&gt;Am I on the right track here or is there a better way to do this? &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:16:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Using-Multiselect-values-in-where-clause/m-p/355798#M23181</guid>
      <dc:creator>ChrisLa</dc:creator>
      <dc:date>2020-09-29T15:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using Multiselect values in where clause</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Using-Multiselect-values-in-where-clause/m-p/355799#M23182</link>
      <description>&lt;P&gt;Try this for the search in your table instead.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=hostname index="index" "BEA"  | rex field=source "(?&amp;lt;LOG_DIRr&amp;gt;[\w\W/]+)/(?&amp;lt;DOMAIN_NAME&amp;gt;[^.]+)/(?&amp;lt;JVM_NAME&amp;gt;[^.]+)/(?&amp;lt;LOG_NAME&amp;gt;[^.]+).*"  | search $domain_name_dropdown$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You might have to put an &lt;CODE&gt;OR&lt;/CODE&gt; in the delimiter of the multiselect. &lt;/P&gt;

&lt;P&gt;Basically you need to filter your results of your search after you extract your DOMAIN_NAME with the regex or the search doesn't know what it is. That is assuming I am reading your question correctly.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2017 13:53:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Using-Multiselect-values-in-where-clause/m-p/355799#M23182</guid>
      <dc:creator>MattZerfas</dc:creator>
      <dc:date>2017-08-09T13:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: Using Multiselect values in where clause</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Using-Multiselect-values-in-where-clause/m-p/355800#M23183</link>
      <description>&lt;P&gt;I think you understood the question, but it doesn't look like this is working either. If I don't select a domain name in the multiselect and just use the default of *, the search returns results. However if I select one or more domain names, it doesn't return any results.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;label&amp;gt;DOMAIN NAME&amp;lt;/label&amp;gt;
  &amp;lt;fieldForLabel&amp;gt;DOMAIN_NAME&amp;lt;/fieldForLabel&amp;gt;
  &amp;lt;fieldForValue&amp;gt;DOMAIN_NAME&amp;lt;/fieldForValue&amp;gt;
  &amp;lt;prefix&amp;gt;(&amp;lt;/prefix&amp;gt;
  &amp;lt;suffix&amp;gt;)&amp;lt;/suffix&amp;gt;
  &amp;lt;delimiter&amp;gt;OR&amp;lt;/delimiter&amp;gt;
  &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
  &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there any way to see the value of $domain_name_dropdown$ that is being used in the search?  &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:16:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Using-Multiselect-values-in-where-clause/m-p/355800#M23183</guid>
      <dc:creator>ChrisLa</dc:creator>
      <dc:date>2020-09-29T15:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using Multiselect values in where clause</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Using-Multiselect-values-in-where-clause/m-p/355801#M23184</link>
      <description>&lt;P&gt;Yeah you can see what it used in the search. After it returns no results just hit "open in search" in the bottom right of the panel. Try this instead. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;label&amp;gt;DOMAIN NAME&amp;lt;/label&amp;gt;
   &amp;lt;fieldForLabel&amp;gt;DOMAIN_NAME&amp;lt;/fieldForLabel&amp;gt;
   &amp;lt;fieldForValue&amp;gt;DOMAIN_NAME&amp;lt;/fieldForValue&amp;gt;
   &amp;lt;prefix&amp;gt;(DOMAIN_NAME=&amp;lt;/prefix&amp;gt;
   &amp;lt;suffix&amp;gt;)&amp;lt;/suffix&amp;gt;
   &amp;lt;delimiter&amp;gt; OR DOMAIN_NAME=&amp;lt;/delimiter&amp;gt;
   &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
   &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Aug 2017 15:37:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Using-Multiselect-values-in-where-clause/m-p/355801#M23184</guid>
      <dc:creator>MattZerfas</dc:creator>
      <dc:date>2017-08-09T15:37:41Z</dc:date>
    </item>
  </channel>
</rss>

