<?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: Evaluate difference in average charted value in aggregate search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Evaluate-difference-in-average-charted-value-in-aggregate-search/m-p/72569#M18153</link>
    <description>&lt;P&gt;Thanks for your response, the problem with not using the appendcols is that the resulting bar chart only graphs a single bar for the ave(LR_Trans_Time) and doesn't separate them by LR_Run_Name.  It averages both runs in the chart.&lt;/P&gt;

&lt;P&gt;The chart that I want looks like this&lt;/P&gt;

&lt;P&gt;Trans1_run1||||||||||||||||||||||&lt;/P&gt;

&lt;P&gt;Trans1_run2|||||||||||||||||&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;       0   0.5   1.0    1.5   2.0
             Transaction time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would like to be able to calculate the difference between those 2 ave(times) for each trans between its 2 runs.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 11:55:34 GMT</pubDate>
    <dc:creator>Cuyose</dc:creator>
    <dc:date>2020-09-28T11:55:34Z</dc:date>
    <item>
      <title>Evaluate difference in average charted value in aggregate search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Evaluate-difference-in-average-charted-value-in-aggregate-search/m-p/72567#M18151</link>
      <description>&lt;P&gt;I have a bar chart that I build that graphs the ave transaction response time of web pages between 2 runs.  What I would ultimately like to do is calculate the difference between the average transaction times for the pages and based on a trigger for the % delta display the chart label in a different color.  First off I can't find any examples on the web where someone has done this, they never use a charted aggregate search and anything I try ends up with a malformed eval string.  This is the query I am trying to work with&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="perfdata" source="expense_transaction" LR_Run_Name=1206trunk80131.lrr LR_Trans_Name != *Transaction 
| chart avg(LR_Trans_Time) as 1206trunk80131.lrr by LR_Trans_Name
| appendcols 
  [search index="perfdata" source="expense_transaction" 
   LR_Run_Name=2012_06_trunk_80117.lrr LR_Trans_Name != *Transaction
   | chart avg(LR_Trans_Time) as 2012_06_trunk_80117.lrr by LR_Trans_Name]
| sort by -2012_06_trunk_80117.lrr
| head 10 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Jun 2012 20:25:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Evaluate-difference-in-average-charted-value-in-aggregate-search/m-p/72567#M18151</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2012-06-11T20:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate difference in average charted value in aggregate search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Evaluate-difference-in-average-charted-value-in-aggregate-search/m-p/72568#M18152</link>
      <description>&lt;P&gt;Let's do one thing at a time.  First, this is a better search, giving you the same data&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="perfdata" source="expense_transaction" LR_Run_Name=1206trunk80131.lrr OR LR_Run_Name=2012_06_trunk_80117.lrr LR_Trans_Name!=*Transaction 
| stats avg(LR_TransTime) as avg_trans_time by LR_Trans_Name LR_Run_Name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This should give you results like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;LR_Trans_Name LR_Run_Name              avg_trans_time
trans1        1206trunk80131.lrr       42
trans1        2012_06_trunk_80117.lrr  53
trans2        1206trunk80131.lrr       14
trans2        2012_06_trunk_80117.lrr  13
...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;After that, can you tell me how you intend to display this data in Splunk and what an example trigger and outcome would be?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2012 21:12:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Evaluate-difference-in-average-charted-value-in-aggregate-search/m-p/72568#M18152</guid>
      <dc:creator>araitz</dc:creator>
      <dc:date>2012-06-11T21:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate difference in average charted value in aggregate search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Evaluate-difference-in-average-charted-value-in-aggregate-search/m-p/72569#M18153</link>
      <description>&lt;P&gt;Thanks for your response, the problem with not using the appendcols is that the resulting bar chart only graphs a single bar for the ave(LR_Trans_Time) and doesn't separate them by LR_Run_Name.  It averages both runs in the chart.&lt;/P&gt;

&lt;P&gt;The chart that I want looks like this&lt;/P&gt;

&lt;P&gt;Trans1_run1||||||||||||||||||||||&lt;/P&gt;

&lt;P&gt;Trans1_run2|||||||||||||||||&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;       0   0.5   1.0    1.5   2.0
             Transaction time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would like to be able to calculate the difference between those 2 ave(times) for each trans between its 2 runs.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:55:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Evaluate-difference-in-average-charted-value-in-aggregate-search/m-p/72569#M18153</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2020-09-28T11:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate difference in average charted value in aggregate search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Evaluate-difference-in-average-charted-value-in-aggregate-search/m-p/72570#M18154</link>
      <description>&lt;P&gt;You should be able to do that via:&lt;BR /&gt;
&lt;CODE&gt;-main search from above-&lt;BR /&gt;
    | strcat LR_Trans_Name "_" LR_Run_Name run&lt;BR /&gt;
    | eventstats avg(LR_TransTime) as avg_trans range(LR_TransTime) as range by id&lt;BR /&gt;
    | stats first(range) as range avg(LR_TransTime) as trans_time by run&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;This will get you pretty close.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2012 23:31:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Evaluate-difference-in-average-charted-value-in-aggregate-search/m-p/72570#M18154</guid>
      <dc:creator>araitz</dc:creator>
      <dc:date>2012-06-11T23:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate difference in average charted value in aggregate search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Evaluate-difference-in-average-charted-value-in-aggregate-search/m-p/72571#M18155</link>
      <description>&lt;P&gt;I was able to get the information I wanted in a separate chart with this:&lt;BR /&gt;
index="perfdata" source="expense_transaction" LR_Run_Name=1206trunk80131.lrr LR_Trans_Name = APR* | chart avg(LR_Trans_Time) as avg1 by LR_Trans_Name | appendcols &lt;BR /&gt;
[search index="perfdata" source="expense_transaction" LR_Run_Name=2012_06_trunk_80117.lrr LR_Trans_Name = APR* | chart avg(LR_Trans_Time) as avg2  by LR_Trans_Name] &lt;BR /&gt;
| eval difference=(avg1-avg2)/avg1*100 | chart avg(difference) as "% difference" by LR_Trans_Name | sort -"% difference"&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:55:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Evaluate-difference-in-average-charted-value-in-aggregate-search/m-p/72571#M18155</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2020-09-28T11:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate difference in average charted value in aggregate search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Evaluate-difference-in-average-charted-value-in-aggregate-search/m-p/72572#M18156</link>
      <description>&lt;P&gt;I wanted to get fancy and incorporate these results from the "% difference" graph in the main bar chart so that when the % difference of any reported LR_Trans_Name is +5% or greater for the second run, that bar in the main chart would display red instead of whatever color splunk decides to make it and otherwise have it green.  The other comparison ave(LR_Trans_Time) for the second run can just be a common color(doesn't matter)&lt;/P&gt;

&lt;P&gt;I want the logic of this "% difference" data behind the scenes for the sole purpose of triggering bar color changes.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:55:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Evaluate-difference-in-average-charted-value-in-aggregate-search/m-p/72572#M18156</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2020-09-28T11:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate difference in average charted value in aggregate search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Evaluate-difference-in-average-charted-value-in-aggregate-search/m-p/72573#M18157</link>
      <description>&lt;P&gt;I'm glad that you got it working!  I was trying to avoid the &lt;CODE&gt;append&lt;/CODE&gt;, which is less efficient than running one search, but if it ain't broke don't fix it.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2012 05:10:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Evaluate-difference-in-average-charted-value-in-aggregate-search/m-p/72573#M18157</guid>
      <dc:creator>araitz</dc:creator>
      <dc:date>2012-06-12T05:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate difference in average charted value in aggregate search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Evaluate-difference-in-average-charted-value-in-aggregate-search/m-p/72574#M18158</link>
      <description>&lt;P&gt;I've decided to just show this supplemental graph as a simplechart heat map next to the time difference chart.  Splunk apparently doesnt have any way to customize the color shading and range in heat maps though, which would be very useful.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jun 2012 17:17:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Evaluate-difference-in-average-charted-value-in-aggregate-search/m-p/72574#M18158</guid>
      <dc:creator>Cuyose</dc:creator>
      <dc:date>2012-06-13T17:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: Evaluate difference in average charted value in aggregate search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Evaluate-difference-in-average-charted-value-in-aggregate-search/m-p/72575#M18159</link>
      <description>&lt;P&gt;Yes, it is too bad that CSS wasn't used, but I bet there was a good reason why that choice was made.  You can use application.js to override the default color and range - see &lt;A href="http://splunk-base.splunk.com/answers/3094/customised-data-overlays"&gt;http://splunk-base.splunk.com/answers/3094/customised-data-overlays&lt;/A&gt; to get you started.  I would recommend overriding decorateHeatMap rather than onResultsRendered(), but 6 of one, 1/2 dozen of another.  Wow, I am really hitting all the glib coloquialisms in this thread.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jun 2012 17:33:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Evaluate-difference-in-average-charted-value-in-aggregate-search/m-p/72575#M18159</guid>
      <dc:creator>araitz</dc:creator>
      <dc:date>2012-06-13T17:33:05Z</dc:date>
    </item>
  </channel>
</rss>

