<?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 Help With Simple NOT Search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Need-Help-With-Simple-NOT-Search/m-p/175478#M186652</link>
    <description>&lt;P&gt;Am I missing something though? I want everything in the 1st list that is NOT in the 2nd list. Shouldn't I be using the NOT search?&lt;/P&gt;</description>
    <pubDate>Wed, 11 Dec 2013 19:47:26 GMT</pubDate>
    <dc:creator>andrewkenth</dc:creator>
    <dc:date>2013-12-11T19:47:26Z</dc:date>
    <item>
      <title>Need Help With Simple NOT Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-Help-With-Simple-NOT-Search/m-p/175475#M186649</link>
      <description>&lt;P&gt;I can't beleive I'm coming to Answers to ask this as I've done it many times before but I must be missing something that I'm hoping you can help me find.&lt;/P&gt;

&lt;P&gt;I have a list of events by user and date and I want to show any of those user/date combiation not in the list of user date combinations below:&lt;/P&gt;

&lt;P&gt;List of Events with Users (and Date)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=charlesriver (sourcetype=SQLAPP_Events OR sourcetype=SQLRPT_Events) "Login succeeded for user "  | bucket span=1d _time | stats count first(_time) as Date by _time, SqlServerLogon | rename SqlServerLogon as UserName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;List of Allowed Users (and Date)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=charlesriver (sourcetype=SqlServer_AppDB_Users OR sourcetype=SqlServer_RptDB_Users) | bucket span=1d _time | stats count first(_time) as Date by _time, UserName | table Date, UserName 


index=charlesriver (sourcetype=SQLAPP_Events OR sourcetype=SQLRPT_Events) "Login succeeded for user "  | bucket span=1d _time | stats count first(_time) as Date by _time, SqlServerLogon | rename SqlServerLogon as UserName
| search NOT [ search 
index=charlesriver (sourcetype=SqlServer_AppDB_Users OR sourcetype=SqlServer_RptDB_Users) | bucket span=1d _time | stats count first(_time) as Date by _time, UserName | table Date, UserName 
] 
| eval Date=strftime(Date,"%m/%d/%Y") | table Date, UserName, count | sort -Date
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My raw data and props.conf look like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"TimeStamp","ServerName","HostName","DBName","UserName","LoginType","AssociatedRole"
"Dec 10 2013 12:36AM","426420-SQLCLUS1","426099-WELLDB1","ConfigLogging","dbo","WINDOWS_USER","db_owner"

NO_BINARY_CHECK = 1
pulldown_type = 1
HEADER_MODE = firstline
FIELD_DELIMITER=,
FIELD_QUOTE="
TIME_FORMAT=%b %d %Y %H:%M%p
TIMESTAMP_FIELDS=TimeStamp
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Dec 2013 17:50:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-Help-With-Simple-NOT-Search/m-p/175475#M186649</guid>
      <dc:creator>andrewkenth</dc:creator>
      <dc:date>2013-12-11T17:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help With Simple NOT Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-Help-With-Simple-NOT-Search/m-p/175476#M186650</link>
      <description>&lt;P&gt;What do the results look like when you run the searches separately. Ok?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2013 18:13:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-Help-With-Simple-NOT-Search/m-p/175476#M186650</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-12-11T18:13:19Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help With Simple NOT Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-Help-With-Simple-NOT-Search/m-p/175477#M186651</link>
      <description>&lt;P&gt;Try following&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=charlesriver (sourcetype=SQLAPP_Events OR sourcetype=SQLRPT_Events) "Login succeeded for user "  
| bucket span=1d _time | stats count first(_time) as Date by SqlServerLogon | rename SqlServerLogon as UserName
|search [index=charlesriver (sourcetype=SqlServer_AppDB_Users OR sourcetype=SqlServer_RptDB_Users) 
| bucket span=1d _time| stats first(_time) as Date by UserName]
| eval Date=strftime(Date,"%m/%d/%Y") | table Date, UserName, count | sort -Date
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Dec 2013 18:15:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-Help-With-Simple-NOT-Search/m-p/175477#M186651</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2013-12-11T18:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help With Simple NOT Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-Help-With-Simple-NOT-Search/m-p/175478#M186652</link>
      <description>&lt;P&gt;Am I missing something though? I want everything in the 1st list that is NOT in the 2nd list. Shouldn't I be using the NOT search?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2013 19:47:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-Help-With-Simple-NOT-Search/m-p/175478#M186652</guid>
      <dc:creator>andrewkenth</dc:creator>
      <dc:date>2013-12-11T19:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help With Simple NOT Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-Help-With-Simple-NOT-Search/m-p/175479#M186653</link>
      <description>&lt;P&gt;They do appear to be correct. Only when I combine them do I see  unexpected results.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2013 20:08:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-Help-With-Simple-NOT-Search/m-p/175479#M186653</guid>
      <dc:creator>andrewkenth</dc:creator>
      <dc:date>2013-12-11T20:08:22Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help With Simple NOT Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-Help-With-Simple-NOT-Search/m-p/175480#M186654</link>
      <description>&lt;P&gt;what if you use &lt;CODE&gt;fields + Date, Username&lt;/CODE&gt; instead of &lt;CODE&gt;table&lt;/CODE&gt; at the end of the subsearch&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2013 20:12:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-Help-With-Simple-NOT-Search/m-p/175480#M186654</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-12-11T20:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help With Simple NOT Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-Help-With-Simple-NOT-Search/m-p/175481#M186655</link>
      <description>&lt;P&gt;...and perhaps I should ask, 'unexpected how?'?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2013 20:15:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-Help-With-Simple-NOT-Search/m-p/175481#M186655</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-12-11T20:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help With Simple NOT Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-Help-With-Simple-NOT-Search/m-p/175482#M186656</link>
      <description>&lt;P&gt;No, I have missed it. Please include NOT after "search" command in line 5 of search.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2013 21:07:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-Help-With-Simple-NOT-Search/m-p/175482#M186656</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2013-12-11T21:07:16Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help With Simple NOT Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-Help-With-Simple-NOT-Search/m-p/175483#M186657</link>
      <description>&lt;P&gt;Unexpected meaning I almost always have a match and this search shows that there are never matches. I can manually find the same Date/UserName combination value in each list.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2013 22:00:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-Help-With-Simple-NOT-Search/m-p/175483#M186657</guid>
      <dc:creator>andrewkenth</dc:creator>
      <dc:date>2013-12-11T22:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help With Simple NOT Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-Help-With-Simple-NOT-Search/m-p/175484#M186658</link>
      <description>&lt;P&gt;try including the trim search command in the usernames to see if there are spaces after them.&lt;/P&gt;

&lt;P&gt;Eval UserName=trim(SqlServerLogon)&lt;BR /&gt;&lt;BR /&gt;
Eval UserName=trim(UserName)&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2013 14:32:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-Help-With-Simple-NOT-Search/m-p/175484#M186658</guid>
      <dc:creator>aelliott</dc:creator>
      <dc:date>2013-12-12T14:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help With Simple NOT Search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-Help-With-Simple-NOT-Search/m-p/175485#M186659</link>
      <description>&lt;P&gt;Something seemed to have been wrong with my search string as this works:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=charlesriver (sourcetype=SQLAPP_Events OR sourcetype=SQLRPT_Events) "Login succeeded for user "
|  bucket span=1d _time | stats count first(_time) as Date by _time, SqlServerLogon | rename SqlServerLogon as UserName | table Date UserName count 
| search NOT [ search 
index=charlesriver sourcetype=SqlServer_AppDB_Users OR sourcetype=SqlServer_RptDB_Users | bucket span=1d _time | stats count first(_time) as Date by _time, UserName | table Date UserName | sort -Date
] | eval Date=strftime(Date,"%m/%d/%Y") | table Date, UserName, count | sort -Date
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 12 Dec 2013 15:36:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-Help-With-Simple-NOT-Search/m-p/175485#M186659</guid>
      <dc:creator>andrewkenth</dc:creator>
      <dc:date>2013-12-12T15:36:32Z</dc:date>
    </item>
  </channel>
</rss>

