<?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 get the average of two fields and compare with last event? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-average-of-two-fields-and-compare-with-last-event/m-p/233965#M69535</link>
    <description>&lt;P&gt;My data is similar to this line:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;05112015ZK00S09MAIN
05112015ZK00S14MAIN
05112015ZK00E65MAIN
05102015ZK00E22MAIN
05102015ZK00S01MAIN
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Where the "S" or "E" stands for Status.&lt;BR /&gt;
So I should get the average  of events with Success, the average of Errors.&lt;BR /&gt;
They were both extracted positional regex as "Status"&lt;BR /&gt;
How can I get the average of'em ?&lt;/P&gt;</description>
    <pubDate>Thu, 12 Nov 2015 17:41:26 GMT</pubDate>
    <dc:creator>vtsguerrero</dc:creator>
    <dc:date>2015-11-12T17:41:26Z</dc:date>
    <item>
      <title>How to get the average of two fields and compare with last event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-average-of-two-fields-and-compare-with-last-event/m-p/233962#M69532</link>
      <description>&lt;P&gt;I have a simple search like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main sourcetype=performance Status=*
| eval Status = if(Status=="S","Success","Error")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then I should have a count for each status, example 50 Success and 20 Errors.&lt;BR /&gt;
Then get the average of those two counts, and finally compare this average to last event so I can get the average difference to the last event.&lt;BR /&gt;
How can achieve this?&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2015 17:07:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-average-of-two-fields-and-compare-with-last-event/m-p/233962#M69532</guid>
      <dc:creator>vtsguerrero</dc:creator>
      <dc:date>2015-11-12T17:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the average of two fields and compare with last event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-average-of-two-fields-and-compare-with-last-event/m-p/233963#M69533</link>
      <description>&lt;P&gt;I do not understand.  Show sample events and mockup of desired final data.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2015 17:26:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-average-of-two-fields-and-compare-with-last-event/m-p/233963#M69533</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-11-12T17:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the average of two fields and compare with last event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-average-of-two-fields-and-compare-with-last-event/m-p/233964#M69534</link>
      <description>&lt;P&gt;Are these individual events single-line events with only one value for Status each,  that then are written out in big groups of events, where each group for you constitutes some "event" in the real world? &lt;BR /&gt;
Or are these events large multiline events with multiple values of Status in each?  &lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2015 17:34:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-average-of-two-fields-and-compare-with-last-event/m-p/233964#M69534</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2015-11-12T17:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the average of two fields and compare with last event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-average-of-two-fields-and-compare-with-last-event/m-p/233965#M69535</link>
      <description>&lt;P&gt;My data is similar to this line:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;05112015ZK00S09MAIN
05112015ZK00S14MAIN
05112015ZK00E65MAIN
05102015ZK00E22MAIN
05102015ZK00S01MAIN
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Where the "S" or "E" stands for Status.&lt;BR /&gt;
So I should get the average  of events with Success, the average of Errors.&lt;BR /&gt;
They were both extracted positional regex as "Status"&lt;BR /&gt;
How can I get the average of'em ?&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2015 17:41:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-average-of-two-fields-and-compare-with-last-event/m-p/233965#M69535</guid>
      <dc:creator>vtsguerrero</dc:creator>
      <dc:date>2015-11-12T17:41:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the average of two fields and compare with last event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-average-of-two-fields-and-compare-with-last-event/m-p/233966#M69536</link>
      <description>&lt;P&gt;The basic answer is very easy; like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=main sourcetype=performance Status=* | eval Status = if(Status=="S","Success","Error") | stats count BY Status
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The problem is the "compare to last event" part, which doesn't make sense to me.&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2015 17:46:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-average-of-two-fields-and-compare-with-last-event/m-p/233966#M69536</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-11-12T17:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the average of two fields and compare with last event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-average-of-two-fields-and-compare-with-last-event/m-p/233967#M69537</link>
      <description>&lt;P&gt;I'm sorry but this question doesn't make any sense so I think you're just asking it in a confusing way.  "the average of events with Success, the average of Errors" makes very little sense.  &lt;/P&gt;

&lt;P&gt;Do you want to end up with a single overall average success rate like 37%?&lt;BR /&gt;&lt;BR /&gt;
If so then &lt;BR /&gt;
&lt;CODE&gt;index=main sourcetype=performance Status=* | eval foo=1 | chart count over foo by Status | eval ratio=100*&lt;BR /&gt;
(S/E) | eval ratio=ratio + "%"&lt;/CODE&gt; will do the trick.   &lt;/P&gt;

&lt;P&gt;But this wouldn't incorporate your other requirement, "compare this average to last event so I can get the average difference to the last event" which still doesn't make sense.    &lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2015 18:04:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-average-of-two-fields-and-compare-with-last-event/m-p/233967#M69537</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2015-11-12T18:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the average of two fields and compare with last event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-average-of-two-fields-and-compare-with-last-event/m-p/233968#M69538</link>
      <description>&lt;P&gt;I agree; you gave us the 1st part (sample events) but not the 2nd part (mockup of final desire).&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2015 18:11:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-average-of-two-fields-and-compare-with-last-event/m-p/233968#M69538</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-11-12T18:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the average of two fields and compare with last event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-average-of-two-fields-and-compare-with-last-event/m-p/233969#M69539</link>
      <description>&lt;P&gt;This pretty much solves the problem, just need to get the average of errors and success now...&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2015 18:11:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-average-of-two-fields-and-compare-with-last-event/m-p/233969#M69539</guid>
      <dc:creator>vtsguerrero</dc:creator>
      <dc:date>2015-11-12T18:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the average of two fields and compare with last event?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-average-of-two-fields-and-compare-with-last-event/m-p/233970#M69540</link>
      <description>&lt;P&gt;Well, this person asked us to get a deviation of average status error / success, I'm not acctually sure if this is possible. He wants a red/yellow/green light indicator to show if the deviation is higher less then 30%, less then 50% or higher then 50% deviation&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2015 18:14:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-the-average-of-two-fields-and-compare-with-last-event/m-p/233970#M69540</guid>
      <dc:creator>vtsguerrero</dc:creator>
      <dc:date>2015-11-12T18:14:26Z</dc:date>
    </item>
  </channel>
</rss>

