<?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: Add a independent trendline in splunk in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Add-a-independent-trendline-in-splunk/m-p/290370#M3632</link>
    <description>&lt;P&gt;hey @karthi&lt;/P&gt;

&lt;P&gt;I got the answer for this question try the same search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=cloudfoundry sourcetype=cl**** "cf_foundation=px**" "cf_org_name=Co***" "cf_space_name=de***" "cf_app_name=splunk-log****" "||splunk-logger||" | dedup processLogId| sort -splunkId |search endDate !=null AND status='COMPLETED' |eval start_epoch=strptime(startDate,"%Y-%m-%d %H:%M:%S.%1N")
  |eval _time=start_epoch
  |eval end_epoch=strptime(endDate,"%Y-%m-%d %H:%M:%S.%1N")
  |eval duration=round((end_epoch-start_epoch)/60)
   | chart values(duration) as duration by processLogId | eventstats avg(duration) as avg_duration
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And then go to &lt;CODE&gt;format&amp;gt;&amp;gt;chart overlay&amp;gt;&amp;gt;overlay&amp;gt;&amp;gt;select avg_duration&lt;/CODE&gt;&lt;BR /&gt;
OR in XML just put &lt;CODE&gt;&amp;lt;option name="charting.chart.overlayFields"&amp;gt;avg_duration&amp;lt;/option&amp;gt;&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;let me know if this helps!&lt;/P&gt;</description>
    <pubDate>Mon, 08 Jan 2018 11:20:11 GMT</pubDate>
    <dc:creator>mayurr98</dc:creator>
    <dc:date>2018-01-08T11:20:11Z</dc:date>
    <item>
      <title>Add a independent trendline in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Add-a-independent-trendline-in-splunk/m-p/290369#M3631</link>
      <description>&lt;P&gt;I am having the chart with durations, I want to add a line over the chart with values as avg(duration). I used below query, it works perfectly.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=cloudfoundry sourcetype=cl**** "cf_foundation=px**" "cf_org_name=Co***" "cf_space_name=de***" "cf_app_name=splunk-log****" "||splunk-logger||" | dedup processLogId| sort -splunkId |search endDate !=null AND status='COMPLETED' |eval start_epoch=strptime(startDate,"%Y-%m-%d %H:%M:%S.%1N")
 |eval _time=start_epoch
 |eval end_epoch=strptime(endDate,"%Y-%m-%d %H:%M:%S.%1N")
 |eval duration=round((end_epoch-start_epoch)/60)
  | chart values(duration) as duration by processLogId | eventstats avg(duration) as avg_duration
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But now my requirement was changed that, Chart should based on last 30 days(may vary) and trendline should only based on last 7 days. &lt;/P&gt;

&lt;P&gt;Kindly help me to do it&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2018 10:57:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Add-a-independent-trendline-in-splunk/m-p/290369#M3631</guid>
      <dc:creator>karthi25</dc:creator>
      <dc:date>2018-01-08T10:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: Add a independent trendline in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Add-a-independent-trendline-in-splunk/m-p/290370#M3632</link>
      <description>&lt;P&gt;hey @karthi&lt;/P&gt;

&lt;P&gt;I got the answer for this question try the same search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=cloudfoundry sourcetype=cl**** "cf_foundation=px**" "cf_org_name=Co***" "cf_space_name=de***" "cf_app_name=splunk-log****" "||splunk-logger||" | dedup processLogId| sort -splunkId |search endDate !=null AND status='COMPLETED' |eval start_epoch=strptime(startDate,"%Y-%m-%d %H:%M:%S.%1N")
  |eval _time=start_epoch
  |eval end_epoch=strptime(endDate,"%Y-%m-%d %H:%M:%S.%1N")
  |eval duration=round((end_epoch-start_epoch)/60)
   | chart values(duration) as duration by processLogId | eventstats avg(duration) as avg_duration
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And then go to &lt;CODE&gt;format&amp;gt;&amp;gt;chart overlay&amp;gt;&amp;gt;overlay&amp;gt;&amp;gt;select avg_duration&lt;/CODE&gt;&lt;BR /&gt;
OR in XML just put &lt;CODE&gt;&amp;lt;option name="charting.chart.overlayFields"&amp;gt;avg_duration&amp;lt;/option&amp;gt;&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;let me know if this helps!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2018 11:20:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Add-a-independent-trendline-in-splunk/m-p/290370#M3632</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-01-08T11:20:11Z</dc:date>
    </item>
    <item>
      <title>Re: Add a independent trendline in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Add-a-independent-trendline-in-splunk/m-p/290371#M3633</link>
      <description>&lt;P&gt;@mayurr98 Where can I give the time range for the trendline, because the time range for the chart and trendline is different right?&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2018 11:25:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Add-a-independent-trendline-in-splunk/m-p/290371#M3633</guid>
      <dc:creator>karthi25</dc:creator>
      <dc:date>2018-01-08T11:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: Add a independent trendline in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Add-a-independent-trendline-in-splunk/m-p/290372#M3634</link>
      <description>&lt;P&gt;then do this with the settings as told above!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=cloudfoundry sourcetype=cl**** "cf_foundation=px**" "cf_org_name=Co***" "cf_space_name=de***" "cf_app_name=splunk-log****" "||splunk-logger||" 
| dedup processLogId 
| sort -splunkId 
| search endDate !=null AND status='COMPLETED' 
| eval start_epoch=strptime(startDate,"%Y-%m-%d %H:%M:%S.%1N") 
| eval _time=start_epoch 
| eval end_epoch=strptime(endDate,"%Y-%m-%d %H:%M:%S.%1N") 
| eval duration=round((end_epoch-start_epoch)/60) 
| chart values(duration) as duration by processLogId 
| appendcols 
    [ search index=cloudfoundry  earliest=-7d@h latest=now sourcetype=cl**** "cf_foundation=px**" "cf_org_name=Co***" "cf_space_name=de***" "cf_app_name=splunk-log****" "||splunk-logger||" 
    | dedup processLogId 
    | sort -splunkId 
    | search endDate !=null AND status='COMPLETED' 
    | eval start_epoch=strptime(startDate,"%Y-%m-%d %H:%M:%S.%1N") 
    | eval _time=start_epoch 
    | eval end_epoch=strptime(endDate,"%Y-%m-%d %H:%M:%S.%1N") 
    | eval duration=round((end_epoch-start_epoch)/60) 
    | chart values(duration) as duration by processLogId 
    | eventstats avg(duration) as avg_duration] 
| filldown avg_duration
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Jan 2018 11:35:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Add-a-independent-trendline-in-splunk/m-p/290372#M3634</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-01-08T11:35:16Z</dc:date>
    </item>
  </channel>
</rss>

