<?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: Historical trending with timecharts in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Historical-trending-with-timecharts/m-p/34745#M7548</link>
    <description>&lt;P&gt;I've done this in the past by converting the time of the events to a string in a given format (stripping away detail), and then the values are just ordered sets over the same X-axis (time) values.&lt;/P&gt;

&lt;P&gt;Using your example, I'd &lt;CODE&gt;|convert timeformat="%I%P" ctime(_time) AS my_hour&lt;/CODE&gt; then you can chart by my_hour.&lt;/P&gt;

&lt;P&gt;This might be over simplifying a bit, but the basic gist is "build the data sets with an overlapping X-axis value, then plot by that value."  The trick is to get them to sort in "time" order; I was able to do this with advanced charting properties, so this solution is sadly a bit more involved than you might like....&lt;/P&gt;</description>
    <pubDate>Mon, 30 Apr 2012 18:59:56 GMT</pubDate>
    <dc:creator>sowings</dc:creator>
    <dc:date>2012-04-30T18:59:56Z</dc:date>
    <item>
      <title>Historical trending with timecharts</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Historical-trending-with-timecharts/m-p/34740#M7543</link>
      <description>&lt;P&gt;How can you generate a timechart that includes daily per-minute averages for a given metric?   &lt;/P&gt;

&lt;P&gt;I got this far,  but couldn't figure out a way to turn either of these into a timechart. &lt;/P&gt;

&lt;P&gt;&lt;PRE&gt;&lt;CODE&gt; [...] earliest=-30d | eval hour_min=strftime(_time,"%H:%M") | stats avg(pause_time) as avg_pause_time by hour_min &lt;/CODE&gt;&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;&lt;PRE&gt;&lt;CODE&gt; [...] earliest=-30d | stats avg(pause_time) as avg_pause_time by date_hour date_minute  &lt;/CODE&gt;&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;Am I going about this the wrong way?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:43:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Historical-trending-with-timecharts/m-p/34740#M7543</guid>
      <dc:creator>pnoixbeurre</dc:creator>
      <dc:date>2020-09-28T11:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: Historical trending with timecharts</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Historical-trending-with-timecharts/m-p/34741#M7544</link>
      <description>&lt;P&gt;Just use the &lt;CODE&gt;timechart&lt;/CODE&gt; command and set &lt;CODE&gt;span=1m&lt;/CODE&gt;!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | timechart span=1m avg(pause_time)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or am I missing something in your question? Do you want the average for a given time of day, regardless of day?&lt;/P&gt;</description>
      <pubDate>Tue, 24 Apr 2012 21:25:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Historical-trending-with-timecharts/m-p/34741#M7544</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-04-24T21:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: Historical trending with timecharts</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Historical-trending-with-timecharts/m-p/34742#M7545</link>
      <description>&lt;P&gt;My question was unclear.  Sorry about that.  And yes,  I'd like to see the average for a given time of day, regardless of day.  &lt;/P&gt;

&lt;P&gt;Basically,  the purpose of this search is to create a historical trend against which i can compare the values on a given day.  For example,  I'd want to know if the pause_time values of today are greater or less than average compared to the last month's worth of activity.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2012 00:20:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Historical-trending-with-timecharts/m-p/34742#M7545</guid>
      <dc:creator>pnoixbeurre</dc:creator>
      <dc:date>2012-04-25T00:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: Historical trending with timecharts</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Historical-trending-with-timecharts/m-p/34743#M7546</link>
      <description>&lt;P&gt;Ok, you might need to explain more in detail on how you want the results. Do you want a chart that shows individual series for each day in the result set? So you get a chart covering all hours and minutes of a day, and you get one line (or column, or whatever) for today's data, one for yesterday's data, etc etc?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Apr 2012 06:31:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Historical-trending-with-timecharts/m-p/34743#M7546</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-04-25T06:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Historical trending with timecharts</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Historical-trending-with-timecharts/m-p/34744#M7547</link>
      <description>&lt;P&gt;Sure.  Thanks Ayn for helping out here.&lt;/P&gt;

&lt;P&gt;Take these 2 sets of data points (only showing the first couple hours worth of data)&lt;/P&gt;

&lt;P&gt;-- Day 1 --&lt;BR /&gt;
12am: 1&lt;BR /&gt;
1am: 2&lt;BR /&gt;
2am: 2&lt;BR /&gt;
3am: 4&lt;BR /&gt;
...&lt;/P&gt;

&lt;P&gt;-- Day 2 --&lt;BR /&gt;
12am: 0&lt;BR /&gt;
1am: 2&lt;BR /&gt;
2am: 1&lt;BR /&gt;
3am: 2&lt;BR /&gt;
...&lt;/P&gt;

&lt;P&gt;The chart that I'm thinking about would contain a single series with the average over both days.&lt;/P&gt;

&lt;P&gt;-- Trend --&lt;BR /&gt;
12am:(1+0)/2 =&amp;gt; .5&lt;BR /&gt;
1am: (2+2)/2 =&amp;gt; 2 &lt;BR /&gt;
2am: (2+1)/2 =&amp;gt; 1.5&lt;BR /&gt;
3am: (4+2)/2 =&amp;gt; 3&lt;BR /&gt;
...&lt;/P&gt;

&lt;P&gt;This was a simplified example.  In reality, I'd be looking for per-minute averages (instead of the hourly averages shown here).  Also, it would take in more history, say the last 30 days.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Apr 2012 20:31:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Historical-trending-with-timecharts/m-p/34744#M7547</guid>
      <dc:creator>pnoixbeurre</dc:creator>
      <dc:date>2012-04-26T20:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Historical trending with timecharts</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Historical-trending-with-timecharts/m-p/34745#M7548</link>
      <description>&lt;P&gt;I've done this in the past by converting the time of the events to a string in a given format (stripping away detail), and then the values are just ordered sets over the same X-axis (time) values.&lt;/P&gt;

&lt;P&gt;Using your example, I'd &lt;CODE&gt;|convert timeformat="%I%P" ctime(_time) AS my_hour&lt;/CODE&gt; then you can chart by my_hour.&lt;/P&gt;

&lt;P&gt;This might be over simplifying a bit, but the basic gist is "build the data sets with an overlapping X-axis value, then plot by that value."  The trick is to get them to sort in "time" order; I was able to do this with advanced charting properties, so this solution is sadly a bit more involved than you might like....&lt;/P&gt;</description>
      <pubDate>Mon, 30 Apr 2012 18:59:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Historical-trending-with-timecharts/m-p/34745#M7548</guid>
      <dc:creator>sowings</dc:creator>
      <dc:date>2012-04-30T18:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: Historical trending with timecharts</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Historical-trending-with-timecharts/m-p/34746#M7549</link>
      <description>&lt;P&gt;Oh, and you may find &lt;CODE&gt;chart&lt;/CODE&gt; more to your liking if you've tweaked with the X-axis (_time) values at all.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Apr 2012 19:01:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Historical-trending-with-timecharts/m-p/34746#M7549</guid>
      <dc:creator>sowings</dc:creator>
      <dc:date>2012-04-30T19:01:40Z</dc:date>
    </item>
  </channel>
</rss>

