<?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: Stats to Display Counts of FQDNs and IP addresses in Same Column in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Stats-to-Display-Counts-of-FQDNs-and-IP-addresses-in-Same-Column/m-p/159486#M45022</link>
    <description>&lt;P&gt;Thanks for dropping in, lguinn beat you by 3 mins (-:&lt;/P&gt;</description>
    <pubDate>Fri, 10 Oct 2014 20:49:00 GMT</pubDate>
    <dc:creator>kmasood</dc:creator>
    <dc:date>2014-10-10T20:49:00Z</dc:date>
    <item>
      <title>Stats to Display Counts of FQDNs and IP addresses in Same Column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-to-Display-Counts-of-FQDNs-and-IP-addresses-in-Same-Column/m-p/159483#M45019</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have this query, which takes an ip address, returns FQDN and count columns:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search | `ip2fqdn(ip)` | stats count by FQDN
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, there are some ip addresses that do not resolve to FQDNs, and those show up as "No Reverse Lookup". How do I get the ip addresses to appear for those entries in the above query? The result would look like:&lt;/P&gt;

&lt;PRE&gt;
FQDN (or IP)          Count
&lt;A href="https://community.splunk.com/www.domain.tld" target="test_blank"&gt;www.domain.tld&lt;/A&gt;         100
10.1.2.3               75
10.1.2.4               70
example.domain.tld     66
&lt;/PRE&gt;

&lt;P&gt;I've looked at &lt;CODE&gt;coalesce&lt;/CODE&gt; and hoping to avoid doing&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search | `ip2fqdn(ip)` | stats count by FQDN,ip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Update&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Using this query, I've been been able to get what I need:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search | `ip2fqdn(ip)`
| eval myfield=FQDN." ".ip
| rex mode=sed field=myfield "s/No Reverse Lookup//g"
| eval myfield=replace(myfield,"(\w+) \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}","\1")
| stats count by myfield
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there a more efficient way of doing this?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Oct 2014 16:00:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-to-Display-Counts-of-FQDNs-and-IP-addresses-in-Same-Column/m-p/159483#M45019</guid>
      <dc:creator>kmasood</dc:creator>
      <dc:date>2014-10-10T16:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: Stats to Display Counts of FQDNs and IP addresses in Same Column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-to-Display-Counts-of-FQDNs-and-IP-addresses-in-Same-Column/m-p/159484#M45020</link>
      <description>&lt;P&gt;This should do it - I don't know if it will be a lot faster, but it is a lot more simple.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search 
| `ip2fqdn(ip)`
| eval myfield = if(FQDN=="No Reverse Lookup",ip,FQDN)
| stats count by myfield
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Oct 2014 20:42:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-to-Display-Counts-of-FQDNs-and-IP-addresses-in-Same-Column/m-p/159484#M45020</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-10-10T20:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: Stats to Display Counts of FQDNs and IP addresses in Same Column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-to-Display-Counts-of-FQDNs-and-IP-addresses-in-Same-Column/m-p/159485#M45021</link>
      <description>&lt;P&gt;Why not just this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search | `ip2fqdn(ip)` | eval FQDN=if (FQDN="No Reverse Lookup", ip,FQDN) |stats count by FQDN
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Oct 2014 20:44:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-to-Display-Counts-of-FQDNs-and-IP-addresses-in-Same-Column/m-p/159485#M45021</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-10-10T20:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: Stats to Display Counts of FQDNs and IP addresses in Same Column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-to-Display-Counts-of-FQDNs-and-IP-addresses-in-Same-Column/m-p/159486#M45022</link>
      <description>&lt;P&gt;Thanks for dropping in, lguinn beat you by 3 mins (-:&lt;/P&gt;</description>
      <pubDate>Fri, 10 Oct 2014 20:49:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-to-Display-Counts-of-FQDNs-and-IP-addresses-in-Same-Column/m-p/159486#M45022</guid>
      <dc:creator>kmasood</dc:creator>
      <dc:date>2014-10-10T20:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: Stats to Display Counts of FQDNs and IP addresses in Same Column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-to-Display-Counts-of-FQDNs-and-IP-addresses-in-Same-Column/m-p/159487#M45023</link>
      <description>&lt;P&gt;Thank you, just what I was looking for.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Oct 2014 20:49:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-to-Display-Counts-of-FQDNs-and-IP-addresses-in-Same-Column/m-p/159487#M45023</guid>
      <dc:creator>kmasood</dc:creator>
      <dc:date>2014-10-10T20:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: Stats to Display Counts of FQDNs and IP addresses in Same Column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-to-Display-Counts-of-FQDNs-and-IP-addresses-in-Same-Column/m-p/159488#M45024</link>
      <description>&lt;P&gt;Yeah. wish I could type faster like her &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Oct 2014 20:53:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-to-Display-Counts-of-FQDNs-and-IP-addresses-in-Same-Column/m-p/159488#M45024</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-10-10T20:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: Stats to Display Counts of FQDNs and IP addresses in Same Column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-to-Display-Counts-of-FQDNs-and-IP-addresses-in-Same-Column/m-p/159489#M45025</link>
      <description>&lt;P&gt;Hello, is it possible to know what the search macro &lt;CODE&gt;ip2fqdn(ip)&lt;/CODE&gt;does because I am very interesting to implement the same feature?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Oct 2014 14:35:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-to-Display-Counts-of-FQDNs-and-IP-addresses-in-Same-Column/m-p/159489#M45025</guid>
      <dc:creator>erwan_raulet</dc:creator>
      <dc:date>2014-10-15T14:35:06Z</dc:date>
    </item>
    <item>
      <title>Re: Stats to Display Counts of FQDNs and IP addresses in Same Column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-to-Display-Counts-of-FQDNs-and-IP-addresses-in-Same-Column/m-p/159490#M45026</link>
      <description>&lt;P&gt;See the external fields lookup example (&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.3/Knowledge/Addfieldsfromexternaldatasources#External_fields_lookup_example):"&gt;http://docs.splunk.com/Documentation/Splunk/6.1.3/Knowledge/Addfieldsfromexternaldatasources#External_fields_lookup_example):&lt;/A&gt;  -- that ships with Splunk Enterprise&lt;/P&gt;</description>
      <pubDate>Wed, 15 Oct 2014 14:47:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-to-Display-Counts-of-FQDNs-and-IP-addresses-in-Same-Column/m-p/159490#M45026</guid>
      <dc:creator>kmasood</dc:creator>
      <dc:date>2014-10-15T14:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: Stats to Display Counts of FQDNs and IP addresses in Same Column</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Stats-to-Display-Counts-of-FQDNs-and-IP-addresses-in-Same-Column/m-p/159491#M45027</link>
      <description>&lt;P&gt;Thanks for the link &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Oct 2014 15:32:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Stats-to-Display-Counts-of-FQDNs-and-IP-addresses-in-Same-Column/m-p/159491#M45027</guid>
      <dc:creator>erwan_raulet</dc:creator>
      <dc:date>2014-10-15T15:32:19Z</dc:date>
    </item>
  </channel>
</rss>

