<?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 How do you specify a list in WHERE condition? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-specify-a-list-in-WHERE-condition/m-p/448897#M127169</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;I want to display only results which are present in a given list (please see below) :&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;&lt;CODE&gt;....... | xmlkv | stats count by "ApplicationFunction" | WHERE "ApplicationFunction" IN ("Price", "History", "Notify")&lt;/CODE&gt;&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;There are around 10 values that I want to filter out from 30-40 values. So the list specified in &lt;STRONG&gt;IN&lt;/STRONG&gt; will have 10 values.&lt;/LI&gt;
&lt;LI&gt;I want to create an overview dashboard (PieChart).&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;*&lt;EM&gt;Is this possible with Splunk? *&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;If yes, please help me. Otherwise, please specify any possible way to achieve the same.&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;Thanks in advance !&lt;/P&gt;</description>
    <pubDate>Fri, 08 Feb 2019 07:03:02 GMT</pubDate>
    <dc:creator>vaibhavvijay9</dc:creator>
    <dc:date>2019-02-08T07:03:02Z</dc:date>
    <item>
      <title>How do you specify a list in WHERE condition?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-specify-a-list-in-WHERE-condition/m-p/448897#M127169</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;I want to display only results which are present in a given list (please see below) :&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;&lt;CODE&gt;....... | xmlkv | stats count by "ApplicationFunction" | WHERE "ApplicationFunction" IN ("Price", "History", "Notify")&lt;/CODE&gt;&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;There are around 10 values that I want to filter out from 30-40 values. So the list specified in &lt;STRONG&gt;IN&lt;/STRONG&gt; will have 10 values.&lt;/LI&gt;
&lt;LI&gt;I want to create an overview dashboard (PieChart).&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;*&lt;EM&gt;Is this possible with Splunk? *&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;If yes, please help me. Otherwise, please specify any possible way to achieve the same.&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;Thanks in advance !&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2019 07:03:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-specify-a-list-in-WHERE-condition/m-p/448897#M127169</guid>
      <dc:creator>vaibhavvijay9</dc:creator>
      <dc:date>2019-02-08T07:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do you specify a list in WHERE condition?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-specify-a-list-in-WHERE-condition/m-p/448898#M127170</link>
      <description>&lt;P&gt;Hello @vaibhavvijay9&lt;/P&gt;

&lt;P&gt;I think the issue is with double quotes if you mention field name in double quotes in where command then it will become a value which is causing issue in your case. Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    ....... | xmlkv | stats count by ApplicationFunction | WHERE ApplicationFunction IN ("Price", "History", "Notify")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Feb 2019 07:10:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-specify-a-list-in-WHERE-condition/m-p/448898#M127170</guid>
      <dc:creator>vishaltaneja070</dc:creator>
      <dc:date>2019-02-08T07:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do you specify a list in WHERE condition?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-specify-a-list-in-WHERE-condition/m-p/448899#M127171</link>
      <description>&lt;P&gt;And also you can create a lookup of ApplicationFunction and try to filter from there as well. Like below&lt;BR /&gt;
    |stats count by ApplicationFunction | search [|inputlookup ApplicationFunction.csv]&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2019 07:12:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-specify-a-list-in-WHERE-condition/m-p/448899#M127171</guid>
      <dc:creator>vishaltaneja070</dc:creator>
      <dc:date>2019-02-08T07:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do you specify a list in WHERE condition?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-specify-a-list-in-WHERE-condition/m-p/448900#M127172</link>
      <description>&lt;P&gt;Thanks @vishaltaneja07011993 &lt;/P&gt;

&lt;P&gt;Actually my exact field name was &lt;EM&gt;"ns0:ApplicationFunction"&lt;/EM&gt; so when I used it without quotes in WHERE it was resulting in error.&lt;/P&gt;

&lt;P&gt;But I renamed it as &lt;EM&gt;app&lt;/EM&gt; and it worked.&lt;/P&gt;

&lt;P&gt;So my final working string is :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;....... | xmlkv | rename ns0:ApplicationFunction as app | WHERE app IN ("Price", "History", "Notify") | stats count by app
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks Again.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2019 07:49:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-specify-a-list-in-WHERE-condition/m-p/448900#M127172</guid>
      <dc:creator>vaibhavvijay9</dc:creator>
      <dc:date>2019-02-08T07:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: How do you specify a list in WHERE condition?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-specify-a-list-in-WHERE-condition/m-p/448901#M127173</link>
      <description>&lt;P&gt;@vaibhavvijay9 &lt;/P&gt;

&lt;P&gt;Great &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Welcome &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Good Luck&lt;/P&gt;</description>
      <pubDate>Fri, 08 Feb 2019 07:55:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-specify-a-list-in-WHERE-condition/m-p/448901#M127173</guid>
      <dc:creator>vishaltaneja070</dc:creator>
      <dc:date>2019-02-08T07:55:00Z</dc:date>
    </item>
  </channel>
</rss>

