<?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 compare 2 values from Same field? in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/How-to-compare-2-values-from-Same-field/m-p/478475#M9665</link>
    <description>&lt;P&gt;Thanks:) worked swiftly&lt;/P&gt;</description>
    <pubDate>Thu, 09 Jan 2020 15:59:50 GMT</pubDate>
    <dc:creator>samjoshiacademi</dc:creator>
    <dc:date>2020-01-09T15:59:50Z</dc:date>
    <item>
      <title>How to compare 2 values from Same field?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-compare-2-values-from-Same-field/m-p/478473#M9663</link>
      <description>&lt;P&gt;I am having one field and it has 2 values. Comparing them with each other I want to generate a message whether "Success" or "Failure".&lt;BR /&gt;
Below are details:&lt;/P&gt;

&lt;P&gt;// Search&lt;BR /&gt;
 | table _time, ErrorCount | sort 2 _time &lt;/P&gt;

&lt;P&gt;It gives me result like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;         _time                           ErrorCount
       2-Jan-20 16:35:00                  10
       2-Jan-20 16:34:00                  14  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to show "Success" if ErrorCount at latestTime &amp;lt; ErrorCount at earliestTime and failure if its otherwise.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2020 12:28:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-compare-2-values-from-Same-field/m-p/478473#M9663</guid>
      <dc:creator>samjoshiacademi</dc:creator>
      <dc:date>2020-01-02T12:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare 2 values from Same field?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-compare-2-values-from-Same-field/m-p/478474#M9664</link>
      <description>&lt;P&gt;Here is one way to do it:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval data="2-Jan-20 16:35:00,10;
2-Jan-20 16:34:00,14"
| makemv data delim=";" | mvexpand data | rex field=data "(\s|\n?)(?&amp;lt;data&amp;gt;.*)" | makemv data delim=","
| eval _time=strptime(mvindex(data,0),"%d-%b-%y %H:%M:%S"),
     ErrorCount=mvindex(data,1)
| fields _time ErrorCount
| autoregress ErrorCount p=1
| eval status=case(ErrorCount&amp;lt;ErrorCount_p1,"Success",ErrorCount&amp;gt;=ErrorCount_p1,"Failure",1==1,null())
| fields - ErrorCount_p1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This uses autoregress to allow comparison with earlier rows.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2020 13:19:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-compare-2-values-from-Same-field/m-p/478474#M9664</guid>
      <dc:creator>jpolvino</dc:creator>
      <dc:date>2020-01-02T13:19:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare 2 values from Same field?</title>
      <link>https://community.splunk.com/t5/Alerting/How-to-compare-2-values-from-Same-field/m-p/478475#M9665</link>
      <description>&lt;P&gt;Thanks:) worked swiftly&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 15:59:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-to-compare-2-values-from-Same-field/m-p/478475#M9665</guid>
      <dc:creator>samjoshiacademi</dc:creator>
      <dc:date>2020-01-09T15:59:50Z</dc:date>
    </item>
  </channel>
</rss>

