<?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 show Value and Count in a subsearch? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-Value-and-Count-in-a-subsearch/m-p/241897#M71960</link>
    <description>&lt;P&gt;That did it!  Thank you very much.  I must say I really like the community here.&lt;/P&gt;</description>
    <pubDate>Tue, 11 Oct 2016 17:22:55 GMT</pubDate>
    <dc:creator>deathbyearthwor</dc:creator>
    <dc:date>2016-10-11T17:22:55Z</dc:date>
    <item>
      <title>How to show Value and Count in a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-Value-and-Count-in-a-subsearch/m-p/241891#M71954</link>
      <description>&lt;P&gt;My goal is to look at firewall data and pull the top 10 Blocked IPs along with the incoming ports they were hitting.  So I want the IP, then all ports on that IP, and the count of the ports.  Here is what I have so far&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=10.2.2.1 filterlog [search host=10.2.2.1 filterlog | top Source_IP | table Source_IP] | stats values(Source_IP) as IP, values(Destination_Port) as Ports by Source_IP | table IP, Ports
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It works for IP with a list of ports but I cannot get a count of the ports.  Here is what it spits out&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;IP                Port

10.2.2.183        443
                    80
                    993
10.2.2.22       443
                    80
112.138.14.244    51413
119.247.54.238    51413
120.75.230.2        51413
178.93.32.248      51413
180.127.81.72       51413
36.228.5.180        51413
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And I want something more like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;IP                  Port        Count

10.2.2.183          443         22
                      80        25
                      993       148
10.2.2.22            443        7486
                      80        454545
112.138.14.244      51413       14
119.247.54.238      51413      54
120.75.230.2          51413     11
178.93.32.248        51413      1
180.127.81.72        51413      45  
36.228.5.180          51413     454
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Oct 2016 05:12:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-Value-and-Count-in-a-subsearch/m-p/241891#M71954</guid>
      <dc:creator>deathbyearthwor</dc:creator>
      <dc:date>2016-10-11T05:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to show Value and Count in a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-Value-and-Count-in-a-subsearch/m-p/241892#M71955</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=10.2.2.1 filterlog [search host=10.2.2.1 filterlog | top Source_IP | table Source_IP] | stats count by Source_IP Destination_Ports | stats list(Destination_Ports) as Ports list(count) as Count by Source_IP | rename Source_IP AS IP
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Oct 2016 15:53:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-Value-and-Count-in-a-subsearch/m-p/241892#M71955</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-10-11T15:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to show Value and Count in a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-Value-and-Count-in-a-subsearch/m-p/241893#M71956</link>
      <description>&lt;P&gt;That worked perfectly!  Now it doesn't show the data on the column chart like I'd want to.  If I tell it to stack with that data it stacks the port number itself and then the count.  I want the port numbers to be in the legend of the graph but not treat it as a number to add to the graph.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2016 16:35:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-Value-and-Count-in-a-subsearch/m-p/241893#M71956</guid>
      <dc:creator>deathbyearthwor</dc:creator>
      <dc:date>2016-10-11T16:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to show Value and Count in a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-Value-and-Count-in-a-subsearch/m-p/241894#M71957</link>
      <description>&lt;P&gt;If you want to show it in a chart, try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=10.2.2.1 filterlog [search host=10.2.2.1 filterlog | top Source_IP | table Source_IP] | stats count by Source_IP Destination_Ports | eval Ports=Source_IP."::".Destination_Ports | table Ports count
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Oct 2016 16:41:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-Value-and-Count-in-a-subsearch/m-p/241894#M71957</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-10-11T16:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to show Value and Count in a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-Value-and-Count-in-a-subsearch/m-p/241895#M71958</link>
      <description>&lt;P&gt;That looks like it combined the IP and the port into one string and each column is a single IP:Port pair.  I'd like each column to be a single ip but a stacked graph showing a breakdown of each port by the IP address.  Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2016 17:06:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-Value-and-Count-in-a-subsearch/m-p/241895#M71958</guid>
      <dc:creator>deathbyearthwor</dc:creator>
      <dc:date>2016-10-11T17:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to show Value and Count in a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-Value-and-Count-in-a-subsearch/m-p/241896#M71959</link>
      <description>&lt;P&gt;Sorry mis-understood. Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=10.2.2.1 filterlog [search host=10.2.2.1 filterlog | top Source_IP | table Source_IP] | chart count over Source_IP by Destination_Ports
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Oct 2016 17:18:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-Value-and-Count-in-a-subsearch/m-p/241896#M71959</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-10-11T17:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to show Value and Count in a subsearch?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-show-Value-and-Count-in-a-subsearch/m-p/241897#M71960</link>
      <description>&lt;P&gt;That did it!  Thank you very much.  I must say I really like the community here.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2016 17:22:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-show-Value-and-Count-in-a-subsearch/m-p/241897#M71960</guid>
      <dc:creator>deathbyearthwor</dc:creator>
      <dc:date>2016-10-11T17:22:55Z</dc:date>
    </item>
  </channel>
</rss>

