<?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: Timechart Count by with Where in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Count-by-with-Where/m-p/59791#M14735</link>
    <description>&lt;P&gt;Part of the trouble I'm having is for one, I don't know that I've got the search query order set correctly.  Ultimately, I want to end up with a timechart that plots usage over time for any source IPs that generate over 35000 hits within a 24 hour period.  I think the bucket argument will let me do that but I heard there are only rare cases when you should invoke that with a timechart command.&lt;/P&gt;</description>
    <pubDate>Wed, 11 Sep 2013 13:11:21 GMT</pubDate>
    <dc:creator>wbordeau</dc:creator>
    <dc:date>2013-09-11T13:11:21Z</dc:date>
    <item>
      <title>Timechart Count by with Where</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Count-by-with-Where/m-p/59788#M14732</link>
      <description>&lt;P&gt;I'm trying to narrow down a list of spiders whose traffic is inundating our network.  So far, I've gathered that the number of hits greater than 35000 per 24 hour period is a strong indicator the source connection is a spider.  On top of this, I want to display a timechart graphing the connections over time.&lt;/P&gt;

&lt;P&gt;Essentially, I want to graph excessive clientips that meet a minimum threshold of 35000 hits per day but I want to graph it over a larger time period, like 7 days or even a month.&lt;/P&gt;

&lt;P&gt;The following search isn't working.  I've tried sub searches, I've tried limit, and top but am stuck.&lt;/P&gt;

&lt;P&gt;earliest=-7d@d latest=now sourcetype="squid" | bucket _time span=1d | stats count by clientip | where count &amp;gt; 35000 | timechart span=30m count by clientip&lt;/P&gt;

&lt;P&gt;This search works but takes an insane amount of time.  I think if I can just filter out anything with hits fewer than 35,000 per day, the search would run a little faster.&lt;/P&gt;

&lt;P&gt;earliest=-7d@d latest=now sourcetype="squid" format="AN_SQUID_VIP_HOST_LOG" | timechart span=30m limit=10 useother=f count by clientip&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 14:45:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-Count-by-with-Where/m-p/59788#M14732</guid>
      <dc:creator>wbordeau</dc:creator>
      <dc:date>2020-09-28T14:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart Count by with Where</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Count-by-with-Where/m-p/59789#M14733</link>
      <description>&lt;P&gt;By definition this will take a lot of time, since you'll have to retrieve all events from more than a weeks time. &lt;/P&gt;

&lt;P&gt;Perhaps the user-agent field (if that is being logged) can be used to find spiders. &lt;/P&gt;

&lt;P&gt;Also, search acceleration, or summary indexing, could prove useful here.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2013 07:44:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-Count-by-with-Where/m-p/59789#M14733</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-09-11T07:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart Count by with Where</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Count-by-with-Where/m-p/59790#M14734</link>
      <description>&lt;P&gt;Hi wbordeau&lt;/P&gt;

&lt;P&gt;like /k said, your search is slow because of the data amount and because of the &lt;CODE&gt;timechart&lt;/CODE&gt; after a &lt;CODE&gt;where&lt;/CODE&gt; after a &lt;CODE&gt;stats&lt;/CODE&gt;.&lt;BR /&gt;
Why don't you simplify your search to something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest=-7d@d latest=now sourcetype="squid" | bucket _time span=1d | stats count by clientip _time | where count &amp;gt; 35000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this should bring back results immediately and you can still use reporting graphs on the result. If the result is useful, set it up as &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.4/Knowledge/Usesummaryindexing"&gt;saved search with summary indexing enabled&lt;/A&gt;. This will speed up your future searches, if you use the summary index in your future searches.&lt;/P&gt;

&lt;P&gt;hope this helps....&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2013 08:25:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-Count-by-with-Where/m-p/59790#M14734</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2013-09-11T08:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart Count by with Where</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Count-by-with-Where/m-p/59791#M14735</link>
      <description>&lt;P&gt;Part of the trouble I'm having is for one, I don't know that I've got the search query order set correctly.  Ultimately, I want to end up with a timechart that plots usage over time for any source IPs that generate over 35000 hits within a 24 hour period.  I think the bucket argument will let me do that but I heard there are only rare cases when you should invoke that with a timechart command.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2013 13:11:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-Count-by-with-Where/m-p/59791#M14735</guid>
      <dc:creator>wbordeau</dc:creator>
      <dc:date>2013-09-11T13:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart Count by with Where</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Count-by-with-Where/m-p/59792#M14736</link>
      <description>&lt;P&gt;You will need to summary index for:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | bucket _time bin=1h | stats count as reqs_per_ip by clientip, _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That should produce the count of reqs per ip per hour. It would then be the basis of another query that uses a timechart that sums those reqs with a span of 24h, and uses a where clause to filter the series output to only include the &amp;gt; 35k&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | timechart span=24h sum(reqs_per_ip) as reqs_per_ip_last24h by clientip where max &amp;gt; 35000
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Oct 2016 09:41:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-Count-by-with-Where/m-p/59792#M14736</guid>
      <dc:creator>tedwroks</dc:creator>
      <dc:date>2016-10-19T09:41:01Z</dc:date>
    </item>
  </channel>
</rss>

