<?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 a list of users that have logged in from more than one IP? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-list-of-users-that-have-logged-in-from-more-than/m-p/184048#M53011</link>
    <description>&lt;P&gt;I think @MuS is on the right track here, but I want to throw some other thoughts onto the table, for example: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats values(user_ip) as user_ip by user | where mvcount(user_ip) &amp;gt; 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This search one gets the set of distinct ip addresses for each user, and keeps those who have multiple ip addresses. &lt;/P&gt;

&lt;P&gt;Now MuS uses &lt;CODE&gt;count&lt;/CODE&gt; but depending on framing you may need &lt;CODE&gt;distinct_count&lt;/CODE&gt;. For example Peter and Oleg who logged in twice from the same IP with using &lt;CODE&gt;count&lt;/CODE&gt; (if he was splitting only by user) would get a count of 2 (since they have 2 results with a user_ip field, but they each have only 1 value in that user ip field. The docs on &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.5/SearchReference/CommonStatsFunctions"&gt;functions for stats&lt;/A&gt; and &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.5/SearchReference/CommonEvalFunctions"&gt;functions for eval and where&lt;/A&gt; are really comprehensive resources.&lt;/P&gt;

&lt;P&gt;Something MuS hints at which could be important is that there is that there is a time component to this as well, how do we know / estimate that a session is ended? For example if Hans logs in from home, then goes to the local coffee shop and logs in again he could have two IPs legitimately. Or is your timeframe short enough that 2 different IPs within this frame we would want to detect. As Hans has 2 different IPs at 2 different times, MuS's solution as written wouldn't work, but if we &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.5/SearchReference/bin"&gt;bin&lt;/A&gt; time, that could work. (although the by user_ip is also strange to me).&lt;/P&gt;</description>
    <pubDate>Sun, 23 Aug 2015 20:09:16 GMT</pubDate>
    <dc:creator>acharlieh</dc:creator>
    <dc:date>2015-08-23T20:09:16Z</dc:date>
    <item>
      <title>How to search a list of users that have logged in from more than one IP?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-list-of-users-that-have-logged-in-from-more-than/m-p/184045#M53008</link>
      <description>&lt;P&gt;I have a log some like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Aug 23 19:22:19 server1 Peter logged in from 192.168.1.20
Aug 23 19:22:15 server1 Oleg logged in from 192.168.1.80
Aug 23 19:21:44 server1 Hans logged in from 192.168.1.242
Aug 23 19:20:50 server1 Peter logged in from 192.168.1.20
Aug 23 19:20:34 server1 Hans logged in from 192.168.1.66
Aug 23 19:19:36 server1 Oleg logged in from 192.168.1.80
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Where &lt;STRONG&gt;user&lt;/STRONG&gt; = Peter, Oleg etc&lt;BR /&gt;
And &lt;STRONG&gt;user_ip&lt;/STRONG&gt; = 192.168.1.20, 192.168.1.80 etc&lt;/P&gt;

&lt;P&gt;I know how to use dedup etc to find unique data, but how do I do to get a list of users that have logged in from more than one IP?&lt;/P&gt;

&lt;P&gt;So for this data, I'd like to get :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Hans 192.168.1.242
Hans 192.168.1.66
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 23 Aug 2015 18:34:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-list-of-users-that-have-logged-in-from-more-than/m-p/184045#M53008</guid>
      <dc:creator>lakromani</dc:creator>
      <dc:date>2015-08-23T18:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to search a list of users that have logged in from more than one IP?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-list-of-users-that-have-logged-in-from-more-than/m-p/184046#M53009</link>
      <description>&lt;P&gt;Hi lakromani,&lt;/P&gt;

&lt;P&gt;Try to count the IP by user and filter for more than one count like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search here | stats count(user_ip) AS ipCount by user, user_ip, _time | where ipCount &amp;gt;=1 | table _time, user, user_ip 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Sun, 23 Aug 2015 19:24:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-list-of-users-that-have-logged-in-from-more-than/m-p/184046#M53009</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-08-23T19:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to search a list of users that have logged in from more than one IP?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-list-of-users-that-have-logged-in-from-more-than/m-p/184047#M53010</link>
      <description>&lt;P&gt;Update ping&lt;/P&gt;</description>
      <pubDate>Sun, 23 Aug 2015 19:47:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-list-of-users-that-have-logged-in-from-more-than/m-p/184047#M53010</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-08-23T19:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to search a list of users that have logged in from more than one IP?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-list-of-users-that-have-logged-in-from-more-than/m-p/184048#M53011</link>
      <description>&lt;P&gt;I think @MuS is on the right track here, but I want to throw some other thoughts onto the table, for example: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats values(user_ip) as user_ip by user | where mvcount(user_ip) &amp;gt; 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This search one gets the set of distinct ip addresses for each user, and keeps those who have multiple ip addresses. &lt;/P&gt;

&lt;P&gt;Now MuS uses &lt;CODE&gt;count&lt;/CODE&gt; but depending on framing you may need &lt;CODE&gt;distinct_count&lt;/CODE&gt;. For example Peter and Oleg who logged in twice from the same IP with using &lt;CODE&gt;count&lt;/CODE&gt; (if he was splitting only by user) would get a count of 2 (since they have 2 results with a user_ip field, but they each have only 1 value in that user ip field. The docs on &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.5/SearchReference/CommonStatsFunctions"&gt;functions for stats&lt;/A&gt; and &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.5/SearchReference/CommonEvalFunctions"&gt;functions for eval and where&lt;/A&gt; are really comprehensive resources.&lt;/P&gt;

&lt;P&gt;Something MuS hints at which could be important is that there is that there is a time component to this as well, how do we know / estimate that a session is ended? For example if Hans logs in from home, then goes to the local coffee shop and logs in again he could have two IPs legitimately. Or is your timeframe short enough that 2 different IPs within this frame we would want to detect. As Hans has 2 different IPs at 2 different times, MuS's solution as written wouldn't work, but if we &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.5/SearchReference/bin"&gt;bin&lt;/A&gt; time, that could work. (although the by user_ip is also strange to me).&lt;/P&gt;</description>
      <pubDate>Sun, 23 Aug 2015 20:09:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-list-of-users-that-have-logged-in-from-more-than/m-p/184048#M53011</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2015-08-23T20:09:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to search a list of users that have logged in from more than one IP?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-list-of-users-that-have-logged-in-from-more-than/m-p/184049#M53012</link>
      <description>&lt;P&gt;I think as currently written, this would get those users who logged in multiple times from the same IP at the same exact time currently? (As opposed to users who logged in from different ips within a short timeframe?)&lt;/P&gt;</description>
      <pubDate>Sun, 23 Aug 2015 20:10:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-list-of-users-that-have-logged-in-from-more-than/m-p/184049#M53012</guid>
      <dc:creator>acharlieh</dc:creator>
      <dc:date>2015-08-23T20:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to search a list of users that have logged in from more than one IP?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-list-of-users-that-have-logged-in-from-more-than/m-p/184050#M53013</link>
      <description>&lt;P&gt;HeHe, I'm excused &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; wrote that at the airport after a 24 hour plane trip &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Aug 2015 21:09:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-list-of-users-that-have-logged-in-from-more-than/m-p/184050#M53013</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-08-23T21:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to search a list of users that have logged in from more than one IP?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-list-of-users-that-have-logged-in-from-more-than/m-p/184051#M53014</link>
      <description>&lt;P&gt;Thanks acharlieh, this did the trick &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;It gives me some insight on how user logs inn to our system.  I do see that there may be normal that a user has logged inn to the server with two differnet IP.  Some user does have PPPOE so that every new session gets new IP.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Aug 2015 06:41:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-a-list-of-users-that-have-logged-in-from-more-than/m-p/184051#M53014</guid>
      <dc:creator>lakromani</dc:creator>
      <dc:date>2015-08-24T06:41:04Z</dc:date>
    </item>
  </channel>
</rss>

