<?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 values not in a listing in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-values-not-in-a-listing/m-p/757796#M243231</link>
    <description>&lt;P&gt;NB: This is incorrect where in() syntax&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where LanID NOT IN("NAM\\OT00564","NAM\\CHawki5")&lt;/LI-CODE&gt;&lt;P&gt;First parameter to where !in() is fieldname followed by string values.&lt;/P&gt;</description>
    <pubDate>Fri, 30 Jan 2026 04:05:56 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2026-01-30T04:05:56Z</dc:date>
    <item>
      <title>How to search for values not in a listing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-values-not-in-a-listing/m-p/757767#M243223</link>
      <description>&lt;P&gt;I have a search started, but it's failing to run.&amp;nbsp; What I want is to eliminate some ID's and only bring back ID's that are not in a listing:&lt;/P&gt;&lt;P&gt;index IN ("pisupport", "pisupport-np") sourcetype=PIMessage&lt;BR /&gt;("procbook" AND "Successful Login")&lt;BR /&gt;| rex field=_raw "Identity\sList:\s(?&amp;lt;identity&amp;gt;[^.]+)"&lt;BR /&gt;| rex field=_raw "Username\s:\s(?&amp;lt;username&amp;gt;[^.]+)"&lt;BR /&gt;| stats count AS Total_Connections, latest(_time) AS Latest_Timestamp, values(identity) AS Security_Mapping, values(host) AS Connected_Hosts, values(username) as LanID by username&lt;BR /&gt;| eval where LanID NOT IN("NAM\\OT00564",NAM\\CHawki5)&lt;BR /&gt;| eval Latest_Timestamp=strftime(Latest_Timestamp, "%Y-%m-%d %H:%M:%S")&lt;BR /&gt;| sort - Latest_Timestamp&lt;BR /&gt;| table Latest_Timestamp, Total_Connections, LanID, Connected_Hosts, Security_Mapping&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jan 2026 15:52:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-values-not-in-a-listing/m-p/757767#M243223</guid>
      <dc:creator>NanSplk01</dc:creator>
      <dc:date>2026-01-29T15:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for values not in a listing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-values-not-in-a-listing/m-p/757768#M243224</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/243653"&gt;@NanSplk01&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I suppose that you want to filter events where&amp;nbsp;LanID hasn't values "NAM\\OT00564" or "NAM\\CHawki5",&lt;/P&gt;&lt;P&gt;&amp;nbsp;is it correct?&lt;/P&gt;&lt;P&gt;anyway, the eval where row syntax is wrong, try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index IN ("pisupport", "pisupport-np") sourcetype=PIMessage
("procbook" AND "Successful Login")
| rex field=_raw "Identity\sList:\s(?&amp;lt;identity&amp;gt;[^.]+)"
| rex field=_raw "Username\s:\s(?&amp;lt;username&amp;gt;[^.]+)"
| stats count AS Total_Connections, latest(_time) AS Latest_Timestamp, values(identity) AS Security_Mapping, values(host) AS Connected_Hosts, values(username) as LanID by username
| where LanID NOT IN("NAM\\OT00564","NAM\\CHawki5")
| sort -Latest_Timestamp
| eval Latest_Timestamp=strftime(Latest_Timestamp, "%Y-%m-%d %H:%M:%S")
| table Latest_Timestamp, Total_Connections, LanID, Connected_Hosts, Security_Mapping&lt;/LI-CODE&gt;&lt;P&gt;then, it's always better to sort for a timestamp before changing the format.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jan 2026 16:03:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-values-not-in-a-listing/m-p/757768#M243224</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2026-01-29T16:03:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for values not in a listing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-values-not-in-a-listing/m-p/757769#M243225</link>
      <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;in&lt;/FONT&gt; function used with the &lt;FONT face="courier new,courier"&gt;where&lt;/FONT&gt; command has a very different syntax from the &lt;FONT face="courier new,courier"&gt;IN&lt;/FONT&gt; operator used with the &lt;FONT face="courier new,courier"&gt;search&lt;/FONT&gt; command.&amp;nbsp; An additional complication is neither &lt;FONT face="courier new,courier"&gt;in&lt;/FONT&gt; nor &lt;FONT face="courier new,courier"&gt;IN&lt;/FONT&gt; work well with the multi-value fields returned by &lt;FONT face="courier new,courier"&gt;stats&lt;/FONT&gt;.&amp;nbsp; For that, you probably want &lt;FONT face="courier new,courier"&gt;mvfind&lt;/FONT&gt; or do the filtering before &lt;FONT face="courier new,courier"&gt;stats&lt;/FONT&gt;.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index IN ("pisupport", "pisupport-np") sourcetype=PIMessage
("procbook" AND "Successful Login")
| rex field=_raw "Identity\sList:\s(?&amp;lt;identity&amp;gt;[^.]+)"
| rex field=_raw "Username\s:\s(?&amp;lt;username&amp;gt;[^.]+)"
| stats count AS Total_Connections, latest(_time) AS Latest_Timestamp, values(identity) AS Security_Mapping, values(host) AS Connected_Hosts, values(username) as LanID by username
| eval discard=if(isnull(mvfind(LanID, "NAM\\OT00564|NAM\\CHawki5")),1,0)
| where discard=1
| sort - Latest_Timestamp
| eval Latest_Timestamp=strftime(Latest_Timestamp, "%Y-%m-%d %H:%M:%S")
| table Latest_Timestamp, Total_Connections, LanID, Connected_Hosts, Security_Mapping&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jan 2026 16:38:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-values-not-in-a-listing/m-p/757769#M243225</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2026-01-29T16:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for values not in a listing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-values-not-in-a-listing/m-p/757773#M243226</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Giuseppe, unfortunately the search did not work for me.&amp;nbsp; However, you are correct, I want to exclude those ID's from the results of my search and only list ID's that don't match them.&amp;nbsp; I've tried a variety of ways, but I either get nothing, an error, or the ID's still show in the listing.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jan 2026 17:28:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-values-not-in-a-listing/m-p/757773#M243226</guid>
      <dc:creator>NanSplk01</dc:creator>
      <dc:date>2026-01-29T17:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for values not in a listing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-values-not-in-a-listing/m-p/757776#M243227</link>
      <description>&lt;P&gt;I even tried just the following, but it brought back the ID:&lt;/P&gt;&lt;P&gt;index IN ("pisupport", "pisupport-np") sourcetype=PIMessage&lt;BR /&gt;("procbook" AND "Successful Login")&lt;BR /&gt;| rex field=_raw "Identity\sList:\s(?&amp;lt;identity&amp;gt;[^.]+)"&lt;BR /&gt;| rex field=_raw "Username\s:\s(?&amp;lt;username&amp;gt;[^.]+)"&lt;BR /&gt;| dedup username&lt;BR /&gt;| where username!="NAM\\OT00564"&lt;BR /&gt;| table username&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jan 2026 18:59:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-values-not-in-a-listing/m-p/757776#M243227</guid>
      <dc:creator>NanSplk01</dc:creator>
      <dc:date>2026-01-29T18:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for values not in a listing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-values-not-in-a-listing/m-p/757788#M243228</link>
      <description>&lt;P&gt;It's more efficient to filter before &lt;FONT face="courier new,courier"&gt;dedup&lt;/FONT&gt;.&amp;nbsp; It means fewer results are returned to the search head for processing.&lt;/P&gt;&lt;P&gt;I believe you do not need to escape backslashes in strings.&amp;nbsp; &lt;FONT face="courier new,courier"&gt;| where username!=&lt;/FONT&gt;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;"NAM\OT00564"&lt;/FONT&gt; should be sufficient.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jan 2026 21:07:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-values-not-in-a-listing/m-p/757788#M243228</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2026-01-29T21:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for values not in a listing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-values-not-in-a-listing/m-p/757795#M243230</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;says, "IN" functionality is different between the "search" command and the "where" command. The search is&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| search username IN ("A","B","C")&lt;/LI-CODE&gt;&lt;P&gt;The where command is&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where in(username, "A", "B", "C")&lt;/LI-CODE&gt;&lt;P&gt;and these are both string matches. Note that the search command will interpret \ so you will need to escape \ as \\ but oddly enough, not in the where command.&lt;/P&gt;&lt;P&gt;I am not quite sure the purpose of this statement&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats count AS Total_Connections, latest(_time) AS Latest_Timestamp, values(identity) AS Security_Mapping, values(host) AS Connected_Hosts, values(username) as LanID by username&lt;/LI-CODE&gt;&lt;P&gt;because there is no point in doing&amp;nbsp;&lt;STRONG&gt;values(username) as LanID&lt;/STRONG&gt; because that will simply contain the same value as username because you are splitting by username.&lt;/P&gt;&lt;P&gt;So, you could do this before the stats&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where !in(username, "NAM\OT00564", "NAM\CHawki5")
OR
| search username NOT IN ("NAM\\OT00564", "NAM\\CHawki5")&lt;/LI-CODE&gt;&lt;P&gt;and then you want username to be LanID, so just do&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rename username as LanID&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 30 Jan 2026 04:02:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-values-not-in-a-listing/m-p/757795#M243230</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2026-01-30T04:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for values not in a listing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-values-not-in-a-listing/m-p/757796#M243231</link>
      <description>&lt;P&gt;NB: This is incorrect where in() syntax&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where LanID NOT IN("NAM\\OT00564","NAM\\CHawki5")&lt;/LI-CODE&gt;&lt;P&gt;First parameter to where !in() is fieldname followed by string values.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jan 2026 04:05:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-values-not-in-a-listing/m-p/757796#M243231</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2026-01-30T04:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for values not in a listing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-values-not-in-a-listing/m-p/757809#M243232</link>
      <description>&lt;P&gt;Adding to what's already been said here, depending on your data and stats result, the "where" command logic might surprise you if you get multivalued fields.&lt;/P&gt;&lt;P&gt;I'm not sure what your initial intent was but remember than when dealing with multivalued fields Splunk generally applies conditions to each field value separately when deciding whether an event as a whole matches. So you have to use different searches for each of those cases:&lt;/P&gt;&lt;P&gt;- you want to exclude event for which _neither_ of values matches given value&lt;/P&gt;&lt;P&gt;- you want to exlude event which consists solely of the given value&lt;/P&gt;&lt;P&gt;- you want to remove a given value from multivalued field.&lt;/P&gt;&lt;P&gt;- possibly something else.&lt;/P&gt;&lt;P&gt;Also, I disagree here a bit with&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;- it's even better to use fieldformat than eval for formatting timestamps.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jan 2026 16:23:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-values-not-in-a-listing/m-p/757809#M243232</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2026-01-30T16:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for values not in a listing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-values-not-in-a-listing/m-p/757819#M243233</link>
      <description>&lt;P&gt;Maybe we should go back to basics: The data. &amp;nbsp;Instead of trying to filter out, let's see if those username's are even in. &amp;nbsp;How about testing&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index IN ("pisupport", "pisupport-np") sourcetype=PIMessage
("procbook" AND "Successful Login")
| rex field=_raw "Identity\sList:\s(?&amp;lt;identity&amp;gt;[^.]+)"
| rex field=_raw "Username\s:\s(?&amp;lt;username&amp;gt;[^.]+)"
| where username=="NAM\\OT00564"
| table username&lt;/LI-CODE&gt;&lt;P&gt;I have a suspicion that these user names you are trying to exclude do not match the expressions, therefore the above will not return anything.&lt;/P&gt;&lt;P&gt;In other words, the task is not to find or fine tune SPL, but to determine the exact users you are really trying to exclude. &amp;nbsp;If you have difficulty with string for matching, please post exact username you get from raw data.&lt;/P&gt;&lt;P&gt;One more pointer about data and match string. Looking at the samples you give,&amp;nbsp;&lt;SPAN&gt;"NAM\\OT00564" and "NAM\\CHawki5", they look too much like Windows domain users, but with double backslashes. &amp;nbsp;Have you tried single backslash? Like this&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index IN ("pisupport", "pisupport-np") sourcetype=PIMessage
("procbook" AND "Successful Login")
| rex field=_raw "Identity\sList:\s(?&amp;lt;identity&amp;gt;[^.]+)"
| rex field=_raw "Username\s:\s(?&amp;lt;username&amp;gt;[^.]+)"

| where NOT username IN ("NAM\OT00564", "NAM\CHawki5")
| table username&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 31 Jan 2026 17:58:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-values-not-in-a-listing/m-p/757819#M243233</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2026-01-31T17:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for values not in a listing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-values-not-in-a-listing/m-p/757891#M243241</link>
      <description>&lt;P&gt;I was finally able to get it to work with help from you guys:&amp;nbsp;&lt;/P&gt;&lt;P&gt;index IN ("pisupport", "pisupport-np") sourcetype=PIMessage procbook "Successful Login"&lt;BR /&gt;| rex field=_raw "Username\s*:\s*(?&amp;lt;username&amp;gt;\S+)"&lt;BR /&gt;| where NOT match(username, "(?i)(OT00564|CHawki5|DPerez3|AGross2)")&lt;BR /&gt;| dedup username&lt;BR /&gt;| table username&lt;/P&gt;&lt;P&gt;Now I need to add in the other data so they get date and time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks to all&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Feb 2026 12:15:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-values-not-in-a-listing/m-p/757891#M243241</guid>
      <dc:creator>NanSplk01</dc:creator>
      <dc:date>2026-02-03T12:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for values not in a listing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-values-not-in-a-listing/m-p/757892#M243242</link>
      <description>&lt;P&gt;If your problem is resolved, then please click the "Accept as Solution" button to help future readers.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Feb 2026 12:29:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-values-not-in-a-listing/m-p/757892#M243242</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2026-02-03T12:29:18Z</dc:date>
    </item>
  </channel>
</rss>

