<?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: How to search for an id where its column values does not include a certain value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-id-where-its-column-values-does-not-include/m-p/595693#M207323</link>
    <description>&lt;P&gt;This will do that - I assume that the last 55555 should have the extra 5 at the end&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw="ID	PRODUCT	PHONE
1	A	999999
2	A	888888
2	B	888888
1	C	999999
3	D	777777
3	C	777777
3	B	777777
4	B	666666
4	D	666666
5	A	555555
5	B	555555
5	D	555555"
| multikv forceheader=1
| table ID PRODUCT PHONE
| stats values(PRODUCT) as PRODUCTS by ID PHONE
| where isnull(mvfind(PRODUCTS, "C"))
| fields - PRODUCTS&lt;/LI-CODE&gt;&lt;P&gt;You can run this search and it will show you that output - the bit that does the work is from the stats command&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Apr 2022 03:23:47 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2022-04-28T03:23:47Z</dc:date>
    <item>
      <title>How to search for an id where its column values does not include a certain value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-id-where-its-column-values-does-not-include/m-p/595689#M207319</link>
      <description>&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to SPLUNK and I am trying to search for distinct IDs where its PRODUCT column does not include certain value.&lt;/P&gt;&lt;P&gt;For example. If I assume I have the following table called TABLE1:&lt;/P&gt;&lt;TABLE width="291"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="96.3906px" height="25px"&gt;&lt;STRONG&gt;ID&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="96.8594px" height="25px"&gt;&lt;STRONG&gt;PRODUCT&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="96.75px" height="25px"&gt;&lt;STRONG&gt;PHONE&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="96.3906px" height="25px"&gt;1&lt;/TD&gt;&lt;TD width="96.8594px" height="25px"&gt;A&lt;/TD&gt;&lt;TD width="96.75px" height="25px"&gt;999999&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="96.3906px" height="25px"&gt;2&lt;/TD&gt;&lt;TD width="96.8594px" height="25px"&gt;A&lt;/TD&gt;&lt;TD width="96.75px" height="25px"&gt;888888&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="96.3906px" height="25px"&gt;2&lt;/TD&gt;&lt;TD width="96.8594px" height="25px"&gt;B&lt;/TD&gt;&lt;TD width="96.75px" height="25px"&gt;888888&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="96.3906px" height="25px"&gt;1&lt;/TD&gt;&lt;TD width="96.8594px" height="25px"&gt;C&lt;/TD&gt;&lt;TD width="96.75px" height="25px"&gt;999999&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="96.3906px" height="25px"&gt;3&lt;/TD&gt;&lt;TD width="96.8594px" height="25px"&gt;D&lt;/TD&gt;&lt;TD width="96.75px" height="25px"&gt;777777&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="96.3906px" height="25px"&gt;3&lt;/TD&gt;&lt;TD width="96.8594px" height="25px"&gt;C&lt;/TD&gt;&lt;TD width="96.75px" height="25px"&gt;777777&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="96.3906px" height="25px"&gt;3&lt;/TD&gt;&lt;TD width="96.8594px" height="25px"&gt;B&lt;/TD&gt;&lt;TD width="96.75px" height="25px"&gt;777777&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="96.3906px" height="25px"&gt;4&lt;/TD&gt;&lt;TD width="96.8594px" height="25px"&gt;B&lt;/TD&gt;&lt;TD width="96.75px" height="25px"&gt;666666&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="96.3906px" height="25px"&gt;4&lt;/TD&gt;&lt;TD width="96.8594px" height="25px"&gt;D&lt;/TD&gt;&lt;TD width="96.75px" height="25px"&gt;666666&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="96.3906px" height="25px"&gt;5&lt;/TD&gt;&lt;TD width="96.8594px" height="25px"&gt;A&lt;/TD&gt;&lt;TD width="96.75px" height="25px"&gt;555555&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="96.3906px" height="25px"&gt;5&lt;/TD&gt;&lt;TD width="96.8594px" height="25px"&gt;B&lt;/TD&gt;&lt;TD width="96.75px" height="25px"&gt;555555&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="96.3906px" height="25px"&gt;5&lt;/TD&gt;&lt;TD width="96.8594px" height="25px"&gt;D&lt;/TD&gt;&lt;TD width="96.75px" height="25px"&gt;555555&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;...&lt;/TD&gt;&lt;TD&gt;....&lt;/TD&gt;&lt;TD&gt;.....&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want is the following output when I want to look for IDs where its Product column values does not equal C:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" width="126px" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="56.3906px" height="25px"&gt;ID&lt;/TD&gt;&lt;TD width="68.6094px" height="25px"&gt;PHONE&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="56.3906px" height="25px"&gt;2&lt;/TD&gt;&lt;TD width="68.6094px" height="25px"&gt;888888&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="56.3906px" height="25px"&gt;4&lt;/TD&gt;&lt;TD width="68.6094px" height="25px"&gt;666666&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="56.3906px" height="25px"&gt;5&lt;/TD&gt;&lt;TD width="68.6094px" height="25px"&gt;555555&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="56.3906px" height="25px"&gt;....&lt;/TD&gt;&lt;TD width="68.6094px" height="25px"&gt;.....&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to write the search query in splunk?&amp;nbsp; pls help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 03:33:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-id-where-its-column-values-does-not-include/m-p/595689#M207319</guid>
      <dc:creator>amanda_dg</dc:creator>
      <dc:date>2022-04-28T03:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for an id where its column values does not include a certain value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-id-where-its-column-values-does-not-include/m-p/595693#M207323</link>
      <description>&lt;P&gt;This will do that - I assume that the last 55555 should have the extra 5 at the end&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval _raw="ID	PRODUCT	PHONE
1	A	999999
2	A	888888
2	B	888888
1	C	999999
3	D	777777
3	C	777777
3	B	777777
4	B	666666
4	D	666666
5	A	555555
5	B	555555
5	D	555555"
| multikv forceheader=1
| table ID PRODUCT PHONE
| stats values(PRODUCT) as PRODUCTS by ID PHONE
| where isnull(mvfind(PRODUCTS, "C"))
| fields - PRODUCTS&lt;/LI-CODE&gt;&lt;P&gt;You can run this search and it will show you that output - the bit that does the work is from the stats command&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 03:23:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-id-where-its-column-values-does-not-include/m-p/595693#M207323</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-04-28T03:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for an id where its column values does not include a certain value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-id-where-its-column-values-does-not-include/m-p/595695#M207325</link>
      <description>&lt;P&gt;Where to include the index and source type?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 03:34:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-id-where-its-column-values-does-not-include/m-p/595695#M207325</guid>
      <dc:creator>amanda_dg</dc:creator>
      <dc:date>2022-04-28T03:34:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for an id where its column values does not include a certain value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-id-where-its-column-values-does-not-include/m-p/595701#M207328</link>
      <description>&lt;P&gt;I assumed you have a search that already produces that table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;You put your search that produces that table before the stats command&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 04:18:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-id-where-its-column-values-does-not-include/m-p/595701#M207328</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-04-28T04:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for an id where its column values does not include a certain value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-id-where-its-column-values-does-not-include/m-p/595720#M207341</link>
      <description>&lt;P&gt;Hi thank you so much for helping me out &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; It worked&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can I also ask another question?&lt;/P&gt;&lt;P&gt;If I want to find IDs where it purchased Product C but not A, how should I write the search? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 06:10:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-id-where-its-column-values-does-not-include/m-p/595720#M207341</guid>
      <dc:creator>amanda_dg</dc:creator>
      <dc:date>2022-04-28T06:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for an id where its column values does not include a certain value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-id-where-its-column-values-does-not-include/m-p/595722#M207342</link>
      <description>&lt;P&gt;You would use that mvfind again&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where isnotnull(mvfind(PRODUCTS, "C")) AND isnull(mvfind(PRODUCTS, "A"))&lt;/LI-CODE&gt;&lt;P&gt;There are often a number of ways of achieving the same thing, but this works.&lt;/P&gt;&lt;P&gt;Note - if your question is answered, please mark the question as answered, so others can benefit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 06:22:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-id-where-its-column-values-does-not-include/m-p/595722#M207342</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2022-04-28T06:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for an id where its column values does not include a certain value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-id-where-its-column-values-does-not-include/m-p/595730#M207350</link>
      <description>&lt;P&gt;With multivalued fields you can match a bit easier in terms of writing the conditions (but a bit more confusing in interpreting it :-))&lt;/P&gt;&lt;P&gt;Your condition may be rewritten simply as&lt;/P&gt;&lt;PRE&gt;| where PRODUCTS="C" AND NOT PRODUCTS="A"&lt;/PRE&gt;&lt;P&gt;Mind you, it's not the same as&lt;/P&gt;&lt;PRE&gt;| where PRODUCTS="C" AND PRODUCTS!="A"&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 08:10:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-id-where-its-column-values-does-not-include/m-p/595730#M207350</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-04-28T08:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for an id where its column values does not include a certain value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-id-where-its-column-values-does-not-include/m-p/595864#M207411</link>
      <description>&lt;P&gt;Thank you for your reply. if I want to look for multiple PRODUCTS can I use "IN"?&amp;nbsp; Like the following:&lt;/P&gt;&lt;PRE&gt;| where PRODUCTS IN (A, B, C) AND NOT PRODUCTS IN (G, D) &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;How should I put it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 01:19:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-id-where-its-column-values-does-not-include/m-p/595864#M207411</guid>
      <dc:creator>amanda_dg</dc:creator>
      <dc:date>2022-04-29T01:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for an id where its column values does not include a certain value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-id-where-its-column-values-does-not-include/m-p/595865#M207412</link>
      <description>&lt;P&gt;Thank you for your reply. if I want to look for multiple PRODUCTS how should I write? I tried the below search but did not work&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;where isnotnull(mvfind(PRODUCTS, (A,B,C))) AND isnull(mvfind(PRODUCTS,(G,D)))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;How should I put it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 01:36:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-id-where-its-column-values-does-not-include/m-p/595865#M207412</guid>
      <dc:creator>amanda_dg</dc:creator>
      <dc:date>2022-04-29T01:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for an id where its column values does not include a certain value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-id-where-its-column-values-does-not-include/m-p/595889#M207424</link>
      <description>&lt;P&gt;Multivalued fields are sometimes a bit counterintuitive to use but the beauty of them is that your conditions are avaluated for each single value in a multivalued field.&lt;/P&gt;&lt;P&gt;So if you want to limit your result to those in which _any_ of the values in the multivalues field matches any of the values from the given set you can do&lt;/P&gt;&lt;PRE&gt;| search field IN ("value1","value2","value3)&lt;/PRE&gt;&lt;P&gt;But if you want to find results in which you have both "value1" and "value2" in a multivalued field you can use this - as I said - a bit counterintuitive syntax&lt;/P&gt;&lt;PRE&gt;| search field="value1" AND field="value2"&lt;/PRE&gt;&lt;P&gt;If you analyse it in context of a single-valued field it seems pointless because the field cannot be two different values at once. But with multivalued fields since the condition is matched to each value separately, one value in the multivalued field will match "value1" and another one will match "value2".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The opposite is true as well - if you do the negative match on multivalue field if you match&lt;/P&gt;&lt;PRE&gt;| search field!="value1"&lt;/PRE&gt;&lt;P&gt;You will get all the results in which at least one of the values in multivalued fields is different than "value1" (the "value1" may still be present within the multivalue field!)&lt;/P&gt;&lt;P&gt;But if you match with&lt;/P&gt;&lt;PRE&gt;| search NOT field="value1"&lt;/PRE&gt;&lt;P&gt;You'll get only those results when there is no "value1" among values in a multivalued field&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 06:47:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-id-where-its-column-values-does-not-include/m-p/595889#M207424</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-04-29T06:47:20Z</dc:date>
    </item>
  </channel>
</rss>

