<?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 logins not in CSV? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-search-for-logins-not-in-CSV/m-p/309001#M58129</link>
    <description>&lt;P&gt;Sorry, I am really new at Splunk. What would I replace "yourSearchwith_host" in my query?&lt;/P&gt;</description>
    <pubDate>Sat, 31 Mar 2018 19:41:10 GMT</pubDate>
    <dc:creator>albert111</dc:creator>
    <dc:date>2018-03-31T19:41:10Z</dc:date>
    <item>
      <title>How to search for logins not in CSV?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-search-for-logins-not-in-CSV/m-p/308999#M58127</link>
      <description>&lt;P&gt;I am trying to write a query in Splunk that will tell me if any user IDs in my CSV file were used to log into any machines that ARE NOT in my CSV file. I have a CSV file called "MLT_List.csv" with three fields. The second field contains the user IDs and is called "User_ID". The third field is called "Computers". So I want to search Splunk for any successful logins with the user IDs in the CSV that are not logging into any of the computers in the CSV. I don't know if I am being clear or not. Thanks in advance for any help!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:50:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-search-for-logins-not-in-CSV/m-p/308999#M58127</guid>
      <dc:creator>albert111</dc:creator>
      <dc:date>2020-09-29T18:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for logins not in CSV?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-search-for-logins-not-in-CSV/m-p/309000#M58128</link>
      <description>&lt;P&gt;Comparing the result of a search to lookup values is a very commonly used practice and you describe it perfectly.&lt;/P&gt;

&lt;P&gt;The way I phrased it is actually a clue as to how you perform this. &lt;BR /&gt;
You have a lookup table with valid hosts and users. (fields host, user)&lt;BR /&gt;
You have a search that retrieves successful logins and the hosts.&lt;/P&gt;

&lt;P&gt;To filter the search to show only those successful logins that occur on hosts NOT in your CSV you do this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yourSearchwith_host NOT [ inputlookup yourlookup |fields host ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;so for instance you might say something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=blah sourcetype=blah_foo host=* login_status=success NOT [inputlookup legit_user_host.csv | fields host]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To really see what's going on, you'll want to look at the job inspector after it runs.&lt;/P&gt;

&lt;P&gt;to make sense of this, you can run each part of the search independently and imagine the 'venn diagram' the "NOT" creates.&lt;BR /&gt;
&lt;CODE&gt;run index=blah sourcetype=blah_foo host=* login_status=success&lt;/CODE&gt; (any search that gives a list of the successful logins)&lt;BR /&gt;
then you can independently run &lt;CODE&gt;|inputlookup legit_user_host.csv|fields host&lt;/CODE&gt;  run it all together and Splunk will give you the results showing when the data in splunk does NOT match the lookup list.&lt;/P&gt;

&lt;P&gt;If you run the same and remove the NOT you get the list that DOES match... &lt;/P&gt;</description>
      <pubDate>Sat, 31 Mar 2018 01:38:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-search-for-logins-not-in-CSV/m-p/309000#M58128</guid>
      <dc:creator>rsennett_splunk</dc:creator>
      <dc:date>2018-03-31T01:38:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for logins not in CSV?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-search-for-logins-not-in-CSV/m-p/309001#M58129</link>
      <description>&lt;P&gt;Sorry, I am really new at Splunk. What would I replace "yourSearchwith_host" in my query?&lt;/P&gt;</description>
      <pubDate>Sat, 31 Mar 2018 19:41:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-search-for-logins-not-in-CSV/m-p/309001#M58129</guid>
      <dc:creator>albert111</dc:creator>
      <dc:date>2018-03-31T19:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for logins not in CSV?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-search-for-logins-not-in-CSV/m-p/309002#M58130</link>
      <description>&lt;P&gt;understood. I expanded my answer for you. let me know if this helps.&lt;/P&gt;</description>
      <pubDate>Sat, 31 Mar 2018 20:12:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-search-for-logins-not-in-CSV/m-p/309002#M58130</guid>
      <dc:creator>rsennett_splunk</dc:creator>
      <dc:date>2018-03-31T20:12:18Z</dc:date>
    </item>
  </channel>
</rss>

