<?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: Can you help with a Splunk query for filtering a destination port count to a table? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-with-a-Splunk-query-for-filtering-a-destination/m-p/380344#M111329</link>
    <description>&lt;P&gt;One option could be this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=firewall dvc="Devicename*" message_tag="RT_FLOW_SESSION_CREATE" rule="RULENAME" [search index=firewall dvc="Devicename*" message_tag="RT_FLOW_SESSION_CREATE" rule="RULENAME" | stats count by dest_port | sort 200 -count | table dest_port ]| stats count by dest_port src_ip dest_ip 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The subsearch limits the final search result to only include those top 200 dest_ports returned by subsearch.&lt;/P&gt;</description>
    <pubDate>Thu, 20 Sep 2018 18:26:07 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2018-09-20T18:26:07Z</dc:date>
    <item>
      <title>Can you help with a Splunk query for filtering a destination port count to a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-with-a-Splunk-query-for-filtering-a-destination/m-p/380343#M111328</link>
      <description>&lt;P&gt;Hello, everyone,&lt;/P&gt;

&lt;P&gt;I need some help regarding the analysis of a firewall rule that I am trying to analyze via Splunk. What I am trying to do is to filter out a sorted output of the source and destination IP along with the top 200 ports that are used most out of the output.&lt;/P&gt;

&lt;P&gt;Now, when I sort the count then, I lose the capacity of getting the source IP and Destination IP details. THE TABLE SHOULD BE CONSIDERING THE COMPLETE OUTPUT OF TOP 200 PORTS ALONG WITH THE SOURCE IP AND DESTINATION IPS THAT ARE INVOLVED IN THE COMMUNICATION for example &lt;/P&gt;

&lt;P&gt;EXAMPLE &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=firewall dvc="Devicename*" message_tag="RT_FLOW_SESSION_CREATE" rule="RULENAME"  | stats count by dest_port | sort -count 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Sep 2018 18:17:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-with-a-Splunk-query-for-filtering-a-destination/m-p/380343#M111328</guid>
      <dc:creator>vaibhavmehta</dc:creator>
      <dc:date>2018-09-20T18:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help with a Splunk query for filtering a destination port count to a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-with-a-Splunk-query-for-filtering-a-destination/m-p/380344#M111329</link>
      <description>&lt;P&gt;One option could be this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=firewall dvc="Devicename*" message_tag="RT_FLOW_SESSION_CREATE" rule="RULENAME" [search index=firewall dvc="Devicename*" message_tag="RT_FLOW_SESSION_CREATE" rule="RULENAME" | stats count by dest_port | sort 200 -count | table dest_port ]| stats count by dest_port src_ip dest_ip 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The subsearch limits the final search result to only include those top 200 dest_ports returned by subsearch.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 18:26:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-with-a-Splunk-query-for-filtering-a-destination/m-p/380344#M111329</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-09-20T18:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help with a Splunk query for filtering a destination port count to a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-with-a-Splunk-query-for-filtering-a-destination/m-p/380345#M111330</link>
      <description>&lt;P&gt;@vaibhavmehta&lt;/P&gt;

&lt;P&gt;Can you please try following search whether it is giving you desired output?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=firewall dvc="Devicename*" message_tag="RT_FLOW_SESSION_CREATE" rule="RULENAME" | stats values(src) as src values(dest) as dest count by dest_port | sort 200 -count | 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=firewall dvc="Devicename*" message_tag="RT_FLOW_SESSION_CREATE" rule="RULENAME" | stats count by dest_port, dest, src | sort 200 -count 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Just try both and let me know which is as per your requirement or near to it.&lt;BR /&gt;
Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 18:26:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-with-a-Splunk-query-for-filtering-a-destination/m-p/380345#M111330</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-09-20T18:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help with a Splunk query for filtering a destination port count to a table?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-with-a-Splunk-query-for-filtering-a-destination/m-p/380346#M111331</link>
      <description>&lt;P&gt;I already tried the 2nd string but that gives an individual count, but the first string works like a charm &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Validating it for a longer duration now, thanks for the quick response &lt;/P&gt;</description>
      <pubDate>Thu, 20 Sep 2018 21:43:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-with-a-Splunk-query-for-filtering-a-destination/m-p/380346#M111331</guid>
      <dc:creator>vaibhavmehta</dc:creator>
      <dc:date>2018-09-20T21:43:28Z</dc:date>
    </item>
  </channel>
</rss>

