<?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 Extracting unique IP addresses by Username in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extracting-unique-IP-addresses-by-Username/m-p/84911#M21642</link>
    <description>&lt;P&gt;Currently working on a IIS log file with standard fields. I’m looking to first determine the unique Usernames contained in the log and then list the unique IP addresses associated with each Username employed at login.  “My Search String” determines the login event.&lt;/P&gt;

&lt;P&gt;This gets me close:&lt;/P&gt;

&lt;P&gt;index="main"  " My Search String" |  stats list(c_ip) by cs_username &lt;/P&gt;

&lt;P&gt;This produces a list of the correct information except that the list of IP addresses is not unique and that is the problem I’m having trouble solving. Additionally it would be VERY helpful if there was a way to only display the rows if the number of unique IP addresses was greater than 1. The idea is to identify only the logins that have taken place from more than one IP address. I looked into the “WHERE” statement but it doesn’t seem to be designed for this.&lt;/P&gt;

&lt;P&gt;Any help would be much appreciated.&lt;/P&gt;</description>
    <pubDate>Fri, 05 Nov 2010 22:46:55 GMT</pubDate>
    <dc:creator>jginnetty</dc:creator>
    <dc:date>2010-11-05T22:46:55Z</dc:date>
    <item>
      <title>Extracting unique IP addresses by Username</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-unique-IP-addresses-by-Username/m-p/84911#M21642</link>
      <description>&lt;P&gt;Currently working on a IIS log file with standard fields. I’m looking to first determine the unique Usernames contained in the log and then list the unique IP addresses associated with each Username employed at login.  “My Search String” determines the login event.&lt;/P&gt;

&lt;P&gt;This gets me close:&lt;/P&gt;

&lt;P&gt;index="main"  " My Search String" |  stats list(c_ip) by cs_username &lt;/P&gt;

&lt;P&gt;This produces a list of the correct information except that the list of IP addresses is not unique and that is the problem I’m having trouble solving. Additionally it would be VERY helpful if there was a way to only display the rows if the number of unique IP addresses was greater than 1. The idea is to identify only the logins that have taken place from more than one IP address. I looked into the “WHERE” statement but it doesn’t seem to be designed for this.&lt;/P&gt;

&lt;P&gt;Any help would be much appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2010 22:46:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-unique-IP-addresses-by-Username/m-p/84911#M21642</guid>
      <dc:creator>jginnetty</dc:creator>
      <dc:date>2010-11-05T22:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting unique IP addresses by Username</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-unique-IP-addresses-by-Username/m-p/84912#M21643</link>
      <description>&lt;P&gt;Instead of &lt;CODE&gt;stats list&lt;/CODE&gt;, use &lt;CODE&gt;stats values&lt;/CODE&gt; to get the distinct list:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="main" " My Search String" | stats values(c_ip) by cs_username
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To limit to cases where there is more than one distinct value:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="main" " My Search String"
| stats dc(c_ip) as distinctCount values(c_ip) by cs_username
| where distinctCount&amp;gt;1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Nov 2010 23:22:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-unique-IP-addresses-by-Username/m-p/84912#M21643</guid>
      <dc:creator>southeringtonp</dc:creator>
      <dc:date>2010-11-05T23:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting unique IP addresses by Username</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-unique-IP-addresses-by-Username/m-p/84913#M21644</link>
      <description>&lt;P&gt;Very good thanks! That solves problem number one. Is there any way to limit displaying the rows to circumstances where there are two or more IP addresses associated to one Username? This would make the difference between a list of about 10 events and 50 pages of information to page through.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Nov 2010 23:46:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-unique-IP-addresses-by-Username/m-p/84913#M21644</guid>
      <dc:creator>jginnetty</dc:creator>
      <dc:date>2010-11-05T23:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting unique IP addresses by Username</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-unique-IP-addresses-by-Username/m-p/84914#M21645</link>
      <description>&lt;P&gt;See inline edit above.&lt;/P&gt;</description>
      <pubDate>Sat, 06 Nov 2010 00:05:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-unique-IP-addresses-by-Username/m-p/84914#M21645</guid>
      <dc:creator>southeringtonp</dc:creator>
      <dc:date>2010-11-06T00:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting unique IP addresses by Username</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-unique-IP-addresses-by-Username/m-p/84915#M21646</link>
      <description>&lt;P&gt;Very good, that certainly did the trick...&lt;/P&gt;</description>
      <pubDate>Sat, 06 Nov 2010 00:52:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-unique-IP-addresses-by-Username/m-p/84915#M21646</guid>
      <dc:creator>jginnetty</dc:creator>
      <dc:date>2010-11-06T00:52:52Z</dc:date>
    </item>
  </channel>
</rss>

