<?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 display iplocation info for all values in the IP address field belonging to a specific category in Splunk? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-iplocation-info-for-all-values-in-the-IP-address/m-p/218733#M64294</link>
    <description>&lt;P&gt;Well, eventstats will let you keep track of how many unique IPs are seen per username so you can sort on that:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=abc username!="xyz" | eventstats dc(src_ip) AS ip_count by username | dedup username,src_ip | table username,src_ip,ip_count | sort -ip_count,-username | iplocation src_ip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The problem is that you're not going to get the nice cell merging effect that stats values() gives you; mvcombine can sometimes help out here but I'm not sure it will work in this case. This comment might help if you really only want to see the same username once in your results: &lt;A href="https://answers.splunk.com/answers/25102/question-regarding-grouping-of-results-into-a-table.html#comment-25144"&gt;https://answers.splunk.com/answers/25102/question-regarding-grouping-of-results-into-a-table.html#comment-25144&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jun 2016 23:36:04 GMT</pubDate>
    <dc:creator>jtacy</dc:creator>
    <dc:date>2016-06-23T23:36:04Z</dc:date>
    <item>
      <title>How to display iplocation info for all values in the IP address field belonging to a specific category in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-iplocation-info-for-all-values-in-the-IP-address/m-p/218732#M64293</link>
      <description>&lt;P&gt;So my search query gives me the IP addresses pertaining to a user field in the following manner:&lt;/P&gt;

&lt;P&gt;index=abc | stats values(src_ip) by username | where username!="xyz" | iplocation values(ipaddress)&lt;/P&gt;

&lt;P&gt;But the problem is that if a username has more than 1 IP address associated with it, it is skipped over in iplocation, that is, we have no resolution for IP to location mapping in those instances. For example:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;username    values(ipaddress)    city                     country&lt;BR /&gt;
abcxyz          123.456.78.90      amazingcity       amazingcountry&lt;BR /&gt;
xyzabc          122.333.444.56&lt;BR /&gt;
                 234.456.333.444&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;As you can see, the second user has multiple IP addresses associated with it and so &lt;CODE&gt;iplocation&lt;/CODE&gt; just skips over it. How can I modify this query so that it resolves IP address for users with multiple IP addresses. Additionally, I would like to sort the results such that the users with the most IP addresses associated with them show up first.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2016 21:09:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-iplocation-info-for-all-values-in-the-IP-address/m-p/218732#M64293</guid>
      <dc:creator>umichguy</dc:creator>
      <dc:date>2016-06-23T21:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to display iplocation info for all values in the IP address field belonging to a specific category in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-display-iplocation-info-for-all-values-in-the-IP-address/m-p/218733#M64294</link>
      <description>&lt;P&gt;Well, eventstats will let you keep track of how many unique IPs are seen per username so you can sort on that:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=abc username!="xyz" | eventstats dc(src_ip) AS ip_count by username | dedup username,src_ip | table username,src_ip,ip_count | sort -ip_count,-username | iplocation src_ip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The problem is that you're not going to get the nice cell merging effect that stats values() gives you; mvcombine can sometimes help out here but I'm not sure it will work in this case. This comment might help if you really only want to see the same username once in your results: &lt;A href="https://answers.splunk.com/answers/25102/question-regarding-grouping-of-results-into-a-table.html#comment-25144"&gt;https://answers.splunk.com/answers/25102/question-regarding-grouping-of-results-into-a-table.html#comment-25144&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2016 23:36:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-display-iplocation-info-for-all-values-in-the-IP-address/m-p/218733#M64294</guid>
      <dc:creator>jtacy</dc:creator>
      <dc:date>2016-06-23T23:36:04Z</dc:date>
    </item>
  </channel>
</rss>

