<?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 generate an alert for every source accessing multiple distinct destinations within a 30 seconds window? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-an-alert-for-every-source-accessing-multiple/m-p/353832#M104728</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;index= ....... | stats count values(destnIP) by sourceIP
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Adding the &lt;CODE&gt;count&lt;/CODE&gt; in there will give you a count in that stats.  Try that.&lt;/P&gt;</description>
    <pubDate>Fri, 28 Apr 2017 11:34:52 GMT</pubDate>
    <dc:creator>Richfez</dc:creator>
    <dc:date>2017-04-28T11:34:52Z</dc:date>
    <item>
      <title>How to generate an alert for every source accessing multiple distinct destinations within a 30 seconds window?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-an-alert-for-every-source-accessing-multiple/m-p/353831#M104727</link>
      <description>&lt;P&gt;I have a set of sources that access multiple destinations(IPs) &lt;/P&gt;

&lt;P&gt;New to Splunk&lt;BR /&gt;
The query has to be set in such a way that an alert is triggered when any user accesses more than 5 distinct destinations within 30 sec window.&lt;/P&gt;

&lt;P&gt;So far I am able to get distinct destinations accessed by each source by using:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index= ....... | stats values(destnIP) by sourceIP
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The challenge that I am facing is :&lt;BR /&gt;
1.For 'x' number of destnIP for every sourceIP, new column should be created which reflects the number 'x' as in the count of destnIP&lt;BR /&gt;
2. Unable to use commands- count, eval, etc after stats&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2017 11:23:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-an-alert-for-every-source-accessing-multiple/m-p/353831#M104727</guid>
      <dc:creator>512anagha</dc:creator>
      <dc:date>2017-04-28T11:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate an alert for every source accessing multiple distinct destinations within a 30 seconds window?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-an-alert-for-every-source-accessing-multiple/m-p/353832#M104728</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index= ....... | stats count values(destnIP) by sourceIP
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Adding the &lt;CODE&gt;count&lt;/CODE&gt; in there will give you a count in that stats.  Try that.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2017 11:34:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-an-alert-for-every-source-accessing-multiple/m-p/353832#M104728</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2017-04-28T11:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate an alert for every source accessing multiple distinct destinations within a 30 seconds window?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-an-alert-for-every-source-accessing-multiple/m-p/353833#M104729</link>
      <description>&lt;P&gt;Thank you for your reply.&lt;/P&gt;

&lt;P&gt;I could get the count as the total number of destnIP accessed by the sourceIP&lt;/P&gt;

&lt;P&gt;I am unable to the the number of distinct IPs accessed (which is displayed in the Values (destnIP) column&lt;/P&gt;

&lt;P&gt;Thus the number of destnIPs is mot matching the count as count is displayed total (it is also counting when a single IP is accessed multiple times)&lt;/P&gt;

&lt;P&gt;Thankyou so much for your help&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2017 12:55:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-an-alert-for-every-source-accessing-multiple/m-p/353833#M104729</guid>
      <dc:creator>512anagha</dc:creator>
      <dc:date>2017-05-03T12:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate an alert for every source accessing multiple distinct destinations within a 30 seconds window?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-an-alert-for-every-source-accessing-multiple/m-p/353834#M104730</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index= ....... | bin _time span=30s | stats values(destnIP) as dests by sourceIP, _time | stats list(dests) dc(dests) as count by sourceIP, _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should show sourceIP, the 30 second window of the connections, a list of destnIPs for the sourceIP, and a count of connections in that window. To filter out everything &amp;lt;=5 just add a "| where count&amp;gt;5" on the end.&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2017 15:41:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-an-alert-for-every-source-accessing-multiple/m-p/353834#M104730</guid>
      <dc:creator>mdsnmss</dc:creator>
      <dc:date>2017-05-03T15:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate an alert for every source accessing multiple distinct destinations within a 30 seconds window?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-an-alert-for-every-source-accessing-multiple/m-p/353835#M104731</link>
      <description>&lt;P&gt;Strange, gave me access denied posting as an answer but let me post it as a comment...&lt;/P&gt;</description>
      <pubDate>Wed, 03 May 2017 15:41:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-an-alert-for-every-source-accessing-multiple/m-p/353835#M104731</guid>
      <dc:creator>mdsnmss</dc:creator>
      <dc:date>2017-05-03T15:41:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate an alert for every source accessing multiple distinct destinations within a 30 seconds window?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-an-alert-for-every-source-accessing-multiple/m-p/353836#M104732</link>
      <description>&lt;P&gt;Thankyou so much.&lt;BR /&gt;
I could successfully get the required output&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2017 05:57:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-an-alert-for-every-source-accessing-multiple/m-p/353836#M104732</guid>
      <dc:creator>512anagha</dc:creator>
      <dc:date>2017-05-04T05:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate an alert for every source accessing multiple distinct destinations within a 30 seconds window?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-an-alert-for-every-source-accessing-multiple/m-p/353837#M104733</link>
      <description>&lt;P&gt;No problem! Thinking about this a bit more I should note that the 30 second bins essentially reset the count every 30 seconds. So it would catch if there were 5 connections from 12:30:00-12:30:30, but if the 5 connections occurred 12:30:15-12:30:45 it would have reset the count at 12:30:30 and would not be a running count over a 30 second span. &lt;/P&gt;

&lt;P&gt;I'm not sure if this is suitable for you but may be something to consider. I'm still looking at how it could maintain a running count and drop the event count as it  hits 30 seconds older than the newest event in the count. &lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2017 12:15:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-an-alert-for-every-source-accessing-multiple/m-p/353837#M104733</guid>
      <dc:creator>mdsnmss</dc:creator>
      <dc:date>2017-05-04T12:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate an alert for every source accessing multiple distinct destinations within a 30 seconds window?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-an-alert-for-every-source-accessing-multiple/m-p/353838#M104734</link>
      <description>&lt;PRE&gt;&lt;CODE&gt; index= ....... | bin _time span=30s | stats values(destnIP) as dests by sourceIP, _time | stats list(dests) dc(dests) as count by sourceIP, _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should show sourceIP, the 30 second window of the connections, a list of destnIPs for the sourceIP, and a count of connections in that window. To filter out everything &amp;lt;=5 just add a "| where count&amp;gt;5" on the end.&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2017 12:16:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-an-alert-for-every-source-accessing-multiple/m-p/353838#M104734</guid>
      <dc:creator>mdsnmss</dc:creator>
      <dc:date>2017-05-04T12:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate an alert for every source accessing multiple distinct destinations within a 30 seconds window?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-an-alert-for-every-source-accessing-multiple/m-p/353839#M104735</link>
      <description>&lt;P&gt;That sounds like a task for streamstats with &lt;CODE&gt;time_window=30s&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2017 00:37:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-an-alert-for-every-source-accessing-multiple/m-p/353839#M104735</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2017-05-12T00:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to generate an alert for every source accessing multiple distinct destinations within a 30 seconds window?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-generate-an-alert-for-every-source-accessing-multiple/m-p/353840#M104736</link>
      <description>&lt;P&gt;So, this is totally for my own network so you'll have to adjust it for your own needs (just fieldnames), but it searches a 30 second window counting what you need.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=fw src_ip=* 
| sort - _time 
| streamstats time_window=30s dc(DST) as CountOfDistinctDests, count(DST) as CountOfDests, values(DST) as DestsList
| stats list(DestsList) AS Destinations, sum(CountOfDistinctDests) AS "Count of Distinct Destinations" 
   sum(CountOfDests) AS "Count of Destinations" BY src_ip 
| search "Count of Destinations"&amp;gt;5
| table src_ip, Destinations, "Count of Distinct Destinations", "Count of Destinations"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So, fix up the fields (DST, src_ip, etc...) and obviously the index and stuff at the base search.&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2017 01:15:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-generate-an-alert-for-every-source-accessing-multiple/m-p/353840#M104736</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2017-05-12T01:15:06Z</dc:date>
    </item>
  </channel>
</rss>

