<?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: Need where clause query to be implemented on specific value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Need-where-clause-query-to-be-implemented-on-specific-value/m-p/426025#M170734</link>
    <description>&lt;P&gt;Very elegant solution &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jun 2019 06:43:45 GMT</pubDate>
    <dc:creator>FrankVl</dc:creator>
    <dc:date>2019-06-17T06:43:45Z</dc:date>
    <item>
      <title>Need where clause query to be implemented on specific value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-where-clause-query-to-be-implemented-on-specific-value/m-p/426022#M170731</link>
      <description>&lt;P&gt;Hi, If anyone can help.&lt;BR /&gt;
Below is my table which represents volume (count) Country wise. But I want to apply filter like - &lt;BR /&gt;
If only country_code - US and count &amp;gt; 10 or country_code - PH and count &amp;gt; 30 or country_code - NR and count &amp;gt; 10 , &lt;BR /&gt;
then only these country_codes should be visible and for rest all with same value should be visible.&lt;/P&gt;

&lt;P&gt;City_Code   Count&lt;BR /&gt;
US                     10&lt;BR /&gt;
FN                     5&lt;BR /&gt;
IN                    50&lt;BR /&gt;
PH                    30&lt;BR /&gt;
MN                     4&lt;BR /&gt;
KL                     8&lt;BR /&gt;
NR                    11&lt;/P&gt;

&lt;P&gt;So far I have used this query :&lt;/P&gt;

&lt;P&gt;index="countries" |  bucket span=10m _time&lt;BR /&gt;
|  stats count by country_code&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:55:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-where-clause-query-to-be-implemented-on-specific-value/m-p/426022#M170731</guid>
      <dc:creator>sahil237888</dc:creator>
      <dc:date>2020-09-30T00:55:56Z</dc:date>
    </item>
    <item>
      <title>Re: Need where clause query to be implemented on specific value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-where-clause-query-to-be-implemented-on-specific-value/m-p/426023#M170732</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="countries" | bucket span=10m _time
| stats count by country_code
| search (country_code="US" count &amp;gt; 10) OR (country_code="PH" count &amp;gt; 30) OR (country_code="NR" count &amp;gt; 10) OR NOT country_code IN (US,PH,NR)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note: the &lt;CODE&gt;IN&lt;/CODE&gt; operator requires Splunk 6.6 or newer.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2019 13:31:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-where-clause-query-to-be-implemented-on-specific-value/m-p/426023#M170732</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2019-06-14T13:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: Need where clause query to be implemented on specific value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-where-clause-query-to-be-implemented-on-specific-value/m-p/426024#M170733</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/92551"&gt;@sahil237888&lt;/a&gt; ,&lt;/P&gt;

&lt;P&gt;I would use a lookup to do this, setting a threshold list for the countries. &lt;/P&gt;

&lt;P&gt;Example lookup CSV: &lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
City_Code,Threshold&lt;BR /&gt;
US,10&lt;BR /&gt;
PH,30&lt;BR /&gt;
NR,10&lt;BR /&gt;
&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;Then you could do the following search:&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
... [ you search ] ...&lt;BR /&gt;
| table City_Code Count&lt;BR /&gt;
| lookup threshold_lookup City_Code OUTPUT Threshold&lt;BR /&gt;
| fillnull Threshold&lt;BR /&gt;
| where Count &amp;gt; Threshold&lt;BR /&gt;
&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;Here is an example of how it would look using dummy events and data:&lt;BR /&gt;
&lt;IMG src="https://community.splunk.com/storage/temp/273911-screenshot-from-2019-06-14-09-41-38.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:56:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-where-clause-query-to-be-implemented-on-specific-value/m-p/426024#M170733</guid>
      <dc:creator>jnudell_2</dc:creator>
      <dc:date>2020-09-30T00:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: Need where clause query to be implemented on specific value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-where-clause-query-to-be-implemented-on-specific-value/m-p/426025#M170734</link>
      <description>&lt;P&gt;Very elegant solution &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 06:43:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-where-clause-query-to-be-implemented-on-specific-value/m-p/426025#M170734</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2019-06-17T06:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: Need where clause query to be implemented on specific value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-where-clause-query-to-be-implemented-on-specific-value/m-p/426026#M170735</link>
      <description>&lt;P&gt;How can I use * operator with search command or where command - if the country_code is different?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 07:49:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-where-clause-query-to-be-implemented-on-specific-value/m-p/426026#M170735</guid>
      <dc:creator>sahil237888</dc:creator>
      <dc:date>2019-06-17T07:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: Need where clause query to be implemented on specific value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-where-clause-query-to-be-implemented-on-specific-value/m-p/426027#M170736</link>
      <description>&lt;P&gt;I don't really understand your question, can you clarify a bit what you mean?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 07:52:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-where-clause-query-to-be-implemented-on-specific-value/m-p/426027#M170736</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2019-06-17T07:52:22Z</dc:date>
    </item>
  </channel>
</rss>

