<?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 search the number of times an IP address comes up in our network traffic over different time ranges? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-number-of-times-an-IP-address-comes-up-in-our/m-p/282411#M85266</link>
    <description>&lt;P&gt;I'd separate the time-binning and stats-ing into two steps:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=networkTraffic earliest=-120d | eval bin = case(_time &amp;gt;= relative_time(now(), "-30d"), "0-30", _time &amp;gt;= relative_time(now(), "-60d"), "30-60", _time &amp;gt;= relative_time(now(), "-90d"), "60-90", 1=1, "90-120") | stats count by bin Dst_IP
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To make this run at reasonable speed, you'll want to define an accelerated data model for your network traffic, or fill a summary index with daily counts by IP.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Apr 2016 21:34:44 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2016-04-12T21:34:44Z</dc:date>
    <item>
      <title>How to search the number of times an IP address comes up in our network traffic over different time ranges?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-number-of-times-an-IP-address-comes-up-in-our/m-p/282408#M85263</link>
      <description>&lt;P&gt;I'm searching for how frequently an IP address comes up in our network traffic during a 30, 30-60-60-90- and 90-120 day period. My search looks like the one below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=networkTraffic | stats count(Dst_IP) by Dst_IP
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Apr 2016 21:11:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-number-of-times-an-IP-address-comes-up-in-our/m-p/282408#M85263</guid>
      <dc:creator>phspec</dc:creator>
      <dc:date>2016-04-12T21:11:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the number of times an IP address comes up in our network traffic over different time ranges?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-number-of-times-an-IP-address-comes-up-in-our/m-p/282409#M85264</link>
      <description>&lt;P&gt;There likely is a better way to do this, but it works. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=networkTraffic earliest=-120d | stats count count(eval(now()-_time&amp;lt;(86400*30))) as 30d count(eval(now()-_time&amp;gt;(86400*30) and now()-_time&amp;lt;(86400*60))) as "30d-60d" count(eval(now()-_time&amp;gt;(86400*60) and now()-_time&amp;lt;(86400*90))) as "60d-90d" count(eval(now()-_time&amp;gt;(86400*90))) as "90d-120d" by Dst_IP
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Apr 2016 21:28:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-number-of-times-an-IP-address-comes-up-in-our/m-p/282409#M85264</guid>
      <dc:creator>twinspop</dc:creator>
      <dc:date>2016-04-12T21:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the number of times an IP address comes up in our network traffic over different time ranges?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-number-of-times-an-IP-address-comes-up-in-our/m-p/282410#M85265</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=networkTraffic | bucket _time span=30d | stats count(Dst_IP) as count by _time Dst_IP | eval day=floor((now()-_time)/86400) | eval Period=tostring(day)."-".tostring(day+30) | chart values(count) over Dst_IP by Period
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Apr 2016 21:29:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-number-of-times-an-IP-address-comes-up-in-our/m-p/282410#M85265</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-04-12T21:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the number of times an IP address comes up in our network traffic over different time ranges?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-number-of-times-an-IP-address-comes-up-in-our/m-p/282411#M85266</link>
      <description>&lt;P&gt;I'd separate the time-binning and stats-ing into two steps:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=networkTraffic earliest=-120d | eval bin = case(_time &amp;gt;= relative_time(now(), "-30d"), "0-30", _time &amp;gt;= relative_time(now(), "-60d"), "30-60", _time &amp;gt;= relative_time(now(), "-90d"), "60-90", 1=1, "90-120") | stats count by bin Dst_IP
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To make this run at reasonable speed, you'll want to define an accelerated data model for your network traffic, or fill a summary index with daily counts by IP.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 21:34:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-number-of-times-an-IP-address-comes-up-in-our/m-p/282411#M85266</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-04-12T21:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the number of times an IP address comes up in our network traffic over different time ranges?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-number-of-times-an-IP-address-comes-up-in-our/m-p/282412#M85267</link>
      <description>&lt;P&gt;Yeah, I was thinking more in the "arbitrary" ranges mindset without realizing he had requested 30 day buckets. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 22:32:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-number-of-times-an-IP-address-comes-up-in-our/m-p/282412#M85267</guid>
      <dc:creator>twinspop</dc:creator>
      <dc:date>2016-04-12T22:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the number of times an IP address comes up in our network traffic over different time ranges?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-number-of-times-an-IP-address-comes-up-in-our/m-p/282413#M85268</link>
      <description>&lt;P&gt;I get a "120-150" day column even though my &lt;CODE&gt;earliest=-120d@d&lt;/CODE&gt;. I've also tried &lt;CODE&gt;earliest=-120d&lt;/CODE&gt;. Could you possibly point towards why I'm getting an extra 5th column? My search is below&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=networkTraffic earliest=-120d@d | dedup source | bucket _time span=30d | stats count(VDst_IP) as count by _time Dst_IP | eval day=floor((now()-_time)/86400) | eval Period=tostring(day)."-".tostring(day+30) | chart values(count) over Dst_IP by Period | Sort by Dst_IP
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 25 Apr 2016 20:49:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-number-of-times-an-IP-address-comes-up-in-our/m-p/282413#M85268</guid>
      <dc:creator>phspec</dc:creator>
      <dc:date>2016-04-25T20:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the number of times an IP address comes up in our network traffic over different time ranges?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-number-of-times-an-IP-address-comes-up-in-our/m-p/282414#M85269</link>
      <description>&lt;P&gt;The time range &lt;CODE&gt;-120d@d&lt;/CODE&gt; contains things older than 120 days - snap to start of day. Those get sorted into the 120-150 bin.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2016 21:26:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-number-of-times-an-IP-address-comes-up-in-our/m-p/282414#M85269</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-04-25T21:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the number of times an IP address comes up in our network traffic over different time ranges?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-number-of-times-an-IP-address-comes-up-in-our/m-p/282415#M85270</link>
      <description>&lt;P&gt;should I just do &lt;CODE&gt;-120d&lt;/CODE&gt; instead of &lt;CODE&gt;-120d@d&lt;/CODE&gt; then?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2016 21:32:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-number-of-times-an-IP-address-comes-up-in-our/m-p/282415#M85270</guid>
      <dc:creator>phspec</dc:creator>
      <dc:date>2016-04-25T21:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the number of times an IP address comes up in our network traffic over different time ranges?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-number-of-times-an-IP-address-comes-up-in-our/m-p/282416#M85271</link>
      <description>&lt;P&gt;That should work, provided there's no daylight savings time adding an hour.&lt;/P&gt;

&lt;P&gt;The relative_time() approach I posted further down should survive daylight savings time oddities.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2016 21:34:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-number-of-times-an-IP-address-comes-up-in-our/m-p/282416#M85271</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-04-25T21:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the number of times an IP address comes up in our network traffic over different time ranges?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-number-of-times-an-IP-address-comes-up-in-our/m-p/282417#M85272</link>
      <description>&lt;P&gt;so the time section of my search should look like, &lt;CODE&gt;earliest=relative_time(-120d)&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2016 21:45:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-number-of-times-an-IP-address-comes-up-in-our/m-p/282417#M85272</guid>
      <dc:creator>phspec</dc:creator>
      <dc:date>2016-04-25T21:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the number of times an IP address comes up in our network traffic over different time ranges?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-number-of-times-an-IP-address-comes-up-in-our/m-p/282418#M85273</link>
      <description>&lt;P&gt;No, that's no valid syntax. Look at my April 12th comment below.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2016 22:15:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-number-of-times-an-IP-address-comes-up-in-our/m-p/282418#M85273</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-04-25T22:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to search the number of times an IP address comes up in our network traffic over different time ranges?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-number-of-times-an-IP-address-comes-up-in-our/m-p/282419#M85274</link>
      <description>&lt;P&gt;I've done the search with 120d@d, 120d, and relative_time(now(), "-120d"). All of them return a '120-150' column, so I don't believe that column is being returned because of the time range the search is being executed on. I believe the '120-150' column is being made because of this line, 'eval Period=tostring(day)."-".tostring(day+30)', so I'm trying to edit my search to include, 'eval if(day&amp;lt;=120 , Period=tostring(day)."-".tostring(day+30), "NULL")', but I keep getting errors due to incorrect syntax. Any help is appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2016 20:51:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-the-number-of-times-an-IP-address-comes-up-in-our/m-p/282419#M85274</guid>
      <dc:creator>phspec</dc:creator>
      <dc:date>2016-04-27T20:51:02Z</dc:date>
    </item>
  </channel>
</rss>

