<?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 edit my search to chart a trend line over time? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-chart-a-trend-line-over-time/m-p/229989#M68150</link>
    <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  ... | timechart span=1m avg(eval(count/(LATEST-EARLIEST))) AS TPS
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ... | eval TPS=count/(LATEST-EARLIEST) | timechart span=1m avg(TPS) AS TPS
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 27 Jun 2016 17:57:05 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2016-06-27T17:57:05Z</dc:date>
    <item>
      <title>How to edit my search to chart a trend line over time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-chart-a-trend-line-over-time/m-p/229988#M68149</link>
      <description>&lt;P&gt;I am trying to use the below search and plot a graph for the &lt;STRONG&gt;TPS&lt;/STRONG&gt; field.&lt;/P&gt;

&lt;P&gt;So, if I draw a chart with the TPS values over a day (duration) with a span of 1 min/5 mins, it would show a line graph over a day (duration) with the TPS value plotting over time.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; host=X source=Y.log "data available" | stats min(_time) as EARLIEST
 | appendcols [
     search host=X source=Z.log 5.7_WOLFER | stats max(_time) as LATEST ] 
 | appendcols [
     search host=X source=Y | stats count(ITIM_ID) as count ] 
 | eval TPS=count/(LATEST-EARLIEST)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Tried to use timechart in the following way, but didn't work&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | timechart span=1m avg(eval(TPS=count/(LATEST-EARLIEST)))
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/390329/how-to-run-multiple-queries-at-once-with-calculati.html"&gt;https://answers.splunk.com/answers/390329/how-to-run-multiple-queries-at-once-with-calculati.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2016 17:25:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-chart-a-trend-line-over-time/m-p/229988#M68149</guid>
      <dc:creator>koushiknandan</dc:creator>
      <dc:date>2016-06-27T17:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to chart a trend line over time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-chart-a-trend-line-over-time/m-p/229989#M68150</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  ... | timechart span=1m avg(eval(count/(LATEST-EARLIEST))) AS TPS
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ... | eval TPS=count/(LATEST-EARLIEST) | timechart span=1m avg(TPS) AS TPS
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Jun 2016 17:57:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-chart-a-trend-line-over-time/m-p/229989#M68150</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-06-27T17:57:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to chart a trend line over time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-chart-a-trend-line-over-time/m-p/229990#M68151</link>
      <description>&lt;P&gt;Didn't work. &lt;/P&gt;

&lt;P&gt;Adding any of the timechart throws error "No results found".&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2016 11:23:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-chart-a-trend-line-over-time/m-p/229990#M68151</guid>
      <dc:creator>koushiknandan</dc:creator>
      <dc:date>2016-06-28T11:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to chart a trend line over time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-chart-a-trend-line-over-time/m-p/229991#M68152</link>
      <description>&lt;P&gt;Show us the results of your first search.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2016 13:40:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-chart-a-trend-line-over-time/m-p/229991#M68152</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-06-28T13:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to chart a trend line over time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-chart-a-trend-line-over-time/m-p/229992#M68153</link>
      <description>&lt;P&gt;The query would show the following data in a table. I only want the TPS data to show as a trendline (chart).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; Start Time - 2016-04-07 13:41:59
 End Time - 2016-04-07 16:20:59
 Count (ITIM_ID) - 100
 TPS=(End Time-Start Time/Count(ITIM_ID)) - 56.76 *No. as per formulae*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Koushik&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2016 14:07:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-chart-a-trend-line-over-time/m-p/229992#M68153</guid>
      <dc:creator>koushiknandan</dc:creator>
      <dc:date>2016-06-28T14:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to chart a trend line over time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-chart-a-trend-line-over-time/m-p/229993#M68154</link>
      <description>&lt;P&gt;We need to see the actual event data returned by your search, without reformatting/summarizing.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2016 14:16:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-chart-a-trend-line-over-time/m-p/229993#M68154</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-06-28T14:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to chart a trend line over time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-chart-a-trend-line-over-time/m-p/229994#M68155</link>
      <description>&lt;P&gt;PERFORM 2015/06/29 14:11:21 -A- data available: 'XXXXXXX21467025246209'&lt;BR /&gt;
PERFORM 2015/06/29 14:11:21 -A- 5.7_WOLFER 'XXXXXXX21467025246209'&lt;BR /&gt;
PERFORM 2015/06/29 14:11:21 -A- data available: 'XXXXXXX21467025246225'&lt;BR /&gt;
PERFORM 2015/06/29 14:11:21 -A- 5.7_WOLFER 'XXXXXXX21467025246225'&lt;BR /&gt;
PERFORM 2015/06/29 14:11:24 -A- data available: 'XXXXXXX21467025246265'&lt;BR /&gt;
PERFORM 2015/06/29 14:11:24 -A- 5.7_WOLFER 'XXXXXXX21467025246225'&lt;BR /&gt;
PERFORM 2015/06/29 14:11:25 -A- data available: 'XXXXXXX21467025246205'&lt;BR /&gt;
PERFORM 2015/06/29 14:11:25 -A- 5.7_WOLFER 'XXXXXXX21467025246225'&lt;/P&gt;

&lt;P&gt;In the above log, count of ITIM_ID is 4&lt;/P&gt;

&lt;P&gt;EARLIEST = 2015/06/29 14:11:21&lt;BR /&gt;
LATEST = 2015/06/29 14:11:25&lt;/P&gt;

&lt;P&gt;Difference = 4 seconds&lt;/P&gt;

&lt;P&gt;TPS = 4/4 = 1&lt;/P&gt;

&lt;P&gt;When I am running the above query for an hour, I am getting TPS value of the hour.&lt;/P&gt;

&lt;P&gt;But, is it possible to get the same data over a trendline, which would say if the TPS value is varying over time, or, remaining fixed? All ideas are welcome.&lt;/P&gt;

&lt;P&gt;Many Thanks,&lt;BR /&gt;
Koushik&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:05:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-chart-a-trend-line-over-time/m-p/229994#M68155</guid>
      <dc:creator>koushiknandan</dc:creator>
      <dc:date>2020-09-29T10:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to chart a trend line over time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-chart-a-trend-line-over-time/m-p/229995#M68156</link>
      <description>&lt;P&gt;@woodcock, can you please help me out on this?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2016 16:35:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-chart-a-trend-line-over-time/m-p/229995#M68156</guid>
      <dc:creator>koushiknandan</dc:creator>
      <dc:date>2016-07-11T16:35:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to chart a trend line over time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-chart-a-trend-line-over-time/m-p/229996#M68157</link>
      <description>&lt;P&gt;Try this (5 min interval)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...  | eval TPS=count/(LATEST-EARLIEST) | bucket bins=288 EARLIEST | stats count TPS by EARLIEST
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Jul 2016 18:23:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-chart-a-trend-line-over-time/m-p/229996#M68157</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-07-11T18:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to chart a trend line over time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-chart-a-trend-line-over-time/m-p/229997#M68158</link>
      <description>&lt;P&gt;I used this to fake the events:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|noop|stats count AS raw|eval raw=
"PERFORM 2015/06/29 14:11:21 -A- data available: 'XXXXXXX21467025246209'::
PERFORM 2015/06/29 14:11:21 -A- 5.7_WOLFER 'XXXXXXX21467025246209'::
PERFORM 2015/06/29 14:11:21 -A- data available: 'XXXXXXX21467025246225'::
PERFORM 2015/06/29 14:11:21 -A- 5.7_WOLFER 'XXXXXXX21467025246225'::
PERFORM 2015/06/29 14:11:24 -A- data available: 'XXXXXXX21467025246265'::
PERFORM 2015/06/29 14:11:24 -A- 5.7_WOLFER 'XXXXXXX21467025246225'::
PERFORM 2015/06/29 14:11:25 -A- data available: 'XXXXXXX21467025246205'::
PERFORM 2015/06/29 14:11:25 -A- 5.7_WOLFER 'XXXXXXX21467025246225'"
| makemv delim="::" raw
| mvexpand raw
| rex field=raw "(?&amp;lt;sourcetype&amp;gt;\S+)\s+(?&amp;lt;time&amp;gt;\S+\s+\S+)\s+-A-\s+(?&amp;lt;ITIM_ID&amp;gt;.*?)\s+'"
| eval _time=strptime(time,"%Y/%m/%d %H:%M:%S")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then I added this which does the work and worked for me:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats range(_time) AS spanSeconds count BY ITIM_ID
| eval TPS = count/spanSeconds
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Jul 2016 23:29:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-chart-a-trend-line-over-time/m-p/229997#M68158</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-07-11T23:29:58Z</dc:date>
    </item>
  </channel>
</rss>

