<?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: Compare Usernames from Search with Lookup (csv) in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Compare-Usernames-from-Search-with-Lookup-csv/m-p/328374#M60935</link>
    <description>&lt;P&gt;hey, thats for the quick comment. The test.csv contains a List of "OK" Users, I want to filter all Users that are not in that List. &lt;/P&gt;</description>
    <pubDate>Mon, 24 Jul 2017 12:41:40 GMT</pubDate>
    <dc:creator>franz__</dc:creator>
    <dc:date>2017-07-24T12:41:40Z</dc:date>
    <item>
      <title>Compare Usernames from Search with Lookup (csv)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Compare-Usernames-from-Search-with-Lookup-csv/m-p/328372#M60933</link>
      <description>&lt;P&gt;So I read a few answer from here, but I could't ge this to work. &lt;/P&gt;

&lt;P&gt;My Seach: &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;search.... | dedup user | table user&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;and I want to to compare this with usernames from a csv. I've uploaded a lookup "test.csv" file one colum named username. I want an Output that shows all Usernames that are not in the csv&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;.... | dedup username | search NOT username [inputlookup test.csv]  | table username&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Shows only the Usernames that are in the List. Can someone help to show all User that are not in the Lookup?&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2017 09:47:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Compare-Usernames-from-Search-with-Lookup-csv/m-p/328372#M60933</guid>
      <dc:creator>franz__</dc:creator>
      <dc:date>2017-07-24T09:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Usernames from Search with Lookup (csv)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Compare-Usernames-from-Search-with-Lookup-csv/m-p/328373#M60934</link>
      <description>&lt;P&gt;hi franz__,&lt;BR /&gt;
try something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your_search
| eval username=upper(username)
| stats count by username 
| append [| inputlookup test.csv | eval count=0, username=upper(username) | fields username count]
| stats sum(count) AS Total by username
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;usernames &amp;gt; 0 are present both in table and in lookup&lt;BR /&gt;
usernames = 0 are only in lookup&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2017 12:31:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Compare-Usernames-from-Search-with-Lookup-csv/m-p/328373#M60934</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-07-24T12:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Usernames from Search with Lookup (csv)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Compare-Usernames-from-Search-with-Lookup-csv/m-p/328374#M60935</link>
      <description>&lt;P&gt;hey, thats for the quick comment. The test.csv contains a List of "OK" Users, I want to filter all Users that are not in that List. &lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2017 12:41:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Compare-Usernames-from-Search-with-Lookup-csv/m-p/328374#M60935</guid>
      <dc:creator>franz__</dc:creator>
      <dc:date>2017-07-24T12:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Usernames from Search with Lookup (csv)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Compare-Usernames-from-Search-with-Lookup-csv/m-p/328375#M60936</link>
      <description>&lt;P&gt;hi franz__,&lt;BR /&gt;
did you inserted in the subsearch also count=0?&lt;BR /&gt;
because in this way all lookup usernames have at least count=0 and in the sum(count) are present.&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2017 13:00:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Compare-Usernames-from-Search-with-Lookup-csv/m-p/328375#M60936</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-07-24T13:00:09Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Usernames from Search with Lookup (csv)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Compare-Usernames-from-Search-with-Lookup-csv/m-p/328376#M60937</link>
      <description>&lt;P&gt;Yes I copied your Query. Both &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;earliest=-24h host="*" sudo:session | rex "pam_unix(sudo:session): session opened for user root by (?[[:alnum:]_.]+)" | dedup user | table user&lt;/P&gt;

&lt;P&gt;earliest=-24h host="*" sudo:session | rex "pam_unix(sudo:session): session opened for user root by (?[[:alnum:]_.]+)" | eval username=upper(username)&lt;BR /&gt;
 | stats count by username &lt;BR /&gt;
 | append [| inputlookup test.csv | eval count=0, username=upper(username) | fields username count]&lt;BR /&gt;
 | stats sum(count) AS Total by username&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Both shows the same Users, your shows the ammont of Logins (nice the stats count command), but the inputlookup / append commands seems to do nothing. &lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:02:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Compare-Usernames-from-Search-with-Lookup-csv/m-p/328376#M60937</guid>
      <dc:creator>franz__</dc:creator>
      <dc:date>2020-09-29T15:02:58Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Usernames from Search with Lookup (csv)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Compare-Usernames-from-Search-with-Lookup-csv/m-p/328377#M60938</link>
      <description>&lt;P&gt;This mod gets the users not in the list&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your_search
 | eval username=upper(username)
 | stats count by username 
 | append [| inputlookup test.csv  | fields username| username=upper(username), count=0, flag="okay user"]
 | stats sum(count) AS Total, values(flag) as flag by username
 | where isnull(flag)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Jul 2017 14:43:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Compare-Usernames-from-Search-with-Lookup-csv/m-p/328377#M60938</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-07-24T14:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Usernames from Search with Lookup (csv)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Compare-Usernames-from-Search-with-Lookup-csv/m-p/328378#M60939</link>
      <description>&lt;P&gt;what's the output of&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup test.csv | eval count=0, username=upper(username) | fields username count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;?&lt;BR /&gt;
username field name is written in the same way both in search and in lookup?&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jul 2017 15:53:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Compare-Usernames-from-Search-with-Lookup-csv/m-p/328378#M60939</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-07-24T15:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Usernames from Search with Lookup (csv)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Compare-Usernames-from-Search-with-Lookup-csv/m-p/328379#M60940</link>
      <description>&lt;P&gt;Use the &lt;CODE&gt;lookup&lt;/CODE&gt; capability, &lt;EM&gt;NOT&lt;/EM&gt; a &lt;CODE&gt;subsearch&lt;/CODE&gt;:&lt;/P&gt;

&lt;P&gt;First this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.... | dedup username | lookup test.csv username OUTPUT username AS foundInLookup
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then either this for "is in file":&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| where isnotnull(foundInLookup)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or this for "is NOT in file":&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| where isnull(foundInLookup)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Jul 2017 21:52:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Compare-Usernames-from-Search-with-Lookup-csv/m-p/328379#M60940</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-07-24T21:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Usernames from Search with Lookup (csv)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Compare-Usernames-from-Search-with-Lookup-csv/m-p/328380#M60941</link>
      <description>&lt;P&gt;I had to add the Columname but then it worked, thanks!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | dedup username | lookup test.csv username OUTPUT username AS foundInLookup | where isnull(foundInLookup) | table username
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Jul 2017 06:34:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Compare-Usernames-from-Search-with-Lookup-csv/m-p/328380#M60941</guid>
      <dc:creator>franz__</dc:creator>
      <dc:date>2017-07-25T06:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: Compare Usernames from Search with Lookup (csv)</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Compare-Usernames-from-Search-with-Lookup-csv/m-p/328381#M60942</link>
      <description>&lt;P&gt;Right, fixed in my answer, too.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2019 17:15:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Compare-Usernames-from-Search-with-Lookup-csv/m-p/328381#M60942</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-07-01T17:15:56Z</dc:date>
    </item>
  </channel>
</rss>

