<?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 transaction endswith usage in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/transaction-endswith-usage/m-p/195476#M56351</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;We are trying to calculate the total system down time in minutes in a tabular format using the below query&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;sourcetype="nodecheck" | rex "System (?&amp;lt;upordown&amp;gt;.*)" | dedup upordown consecutive=true sortby +_time &lt;BR /&gt;
| transaction startswith="System Up" endswith="System Down*" | EVAL Outage(Minutes)=ceiling(duration/60) &lt;BR /&gt;
| TABLE _time Outage(Minutes) | rename _time as DownTimeStart | convert ctime(DownTimeStart) &lt;BR /&gt;
| addcoltotals labelfield=Outage(Minutes) | fillnull value="Total"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;But, somehow we are unable to combine these two types of system down logs "&lt;STRONG&gt;System Down&lt;/STRONG&gt;" &amp;amp; "&lt;STRONG&gt;System Down - Unable to connect to the Database!&lt;/STRONG&gt;" in our total calculation of outage. It somehow just takes the "&lt;STRONG&gt;System Down&lt;/STRONG&gt;" into consideration. Below is the data set.&lt;BR /&gt;
we are unable to use OR clause in the endswith utility under transaction.&lt;/P&gt;

&lt;P&gt;2014-03-17 15:42:01-System Up&lt;BR /&gt;
2014-03-17 15:37:01-System Up&lt;BR /&gt;
2014-03-17 15:32:41-System Down&lt;BR /&gt;
2014-03-17 15:25:01-System Down - Unable to connect to the Database!&lt;BR /&gt;
2014-03-17 15:15:01-System Down - Unable to connect to the Database!&lt;BR /&gt;
2014-03-17 15:05:02-System Down - Unable to connect to the Database!&lt;BR /&gt;
2014-03-17 14:52:01-System Up&lt;BR /&gt;
2014-03-17 14:47:01-System Up&lt;BR /&gt;
2014-03-17 14:42:01-System Up&lt;/P&gt;</description>
    <pubDate>Wed, 19 Mar 2014 21:57:54 GMT</pubDate>
    <dc:creator>sethuk555</dc:creator>
    <dc:date>2014-03-19T21:57:54Z</dc:date>
    <item>
      <title>transaction endswith usage</title>
      <link>https://community.splunk.com/t5/Splunk-Search/transaction-endswith-usage/m-p/195476#M56351</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;We are trying to calculate the total system down time in minutes in a tabular format using the below query&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;sourcetype="nodecheck" | rex "System (?&amp;lt;upordown&amp;gt;.*)" | dedup upordown consecutive=true sortby +_time &lt;BR /&gt;
| transaction startswith="System Up" endswith="System Down*" | EVAL Outage(Minutes)=ceiling(duration/60) &lt;BR /&gt;
| TABLE _time Outage(Minutes) | rename _time as DownTimeStart | convert ctime(DownTimeStart) &lt;BR /&gt;
| addcoltotals labelfield=Outage(Minutes) | fillnull value="Total"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;But, somehow we are unable to combine these two types of system down logs "&lt;STRONG&gt;System Down&lt;/STRONG&gt;" &amp;amp; "&lt;STRONG&gt;System Down - Unable to connect to the Database!&lt;/STRONG&gt;" in our total calculation of outage. It somehow just takes the "&lt;STRONG&gt;System Down&lt;/STRONG&gt;" into consideration. Below is the data set.&lt;BR /&gt;
we are unable to use OR clause in the endswith utility under transaction.&lt;/P&gt;

&lt;P&gt;2014-03-17 15:42:01-System Up&lt;BR /&gt;
2014-03-17 15:37:01-System Up&lt;BR /&gt;
2014-03-17 15:32:41-System Down&lt;BR /&gt;
2014-03-17 15:25:01-System Down - Unable to connect to the Database!&lt;BR /&gt;
2014-03-17 15:15:01-System Down - Unable to connect to the Database!&lt;BR /&gt;
2014-03-17 15:05:02-System Down - Unable to connect to the Database!&lt;BR /&gt;
2014-03-17 14:52:01-System Up&lt;BR /&gt;
2014-03-17 14:47:01-System Up&lt;BR /&gt;
2014-03-17 14:42:01-System Up&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2014 21:57:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/transaction-endswith-usage/m-p/195476#M56351</guid>
      <dc:creator>sethuk555</dc:creator>
      <dc:date>2014-03-19T21:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: transaction endswith usage</title>
      <link>https://community.splunk.com/t5/Splunk-Search/transaction-endswith-usage/m-p/195477#M56352</link>
      <description>&lt;P&gt;I see several problems:&lt;/P&gt;

&lt;P&gt;First, &lt;CODE&gt;(&lt;/CODE&gt; is not a valid character in a field name - unless you use quotation marks and then things get quite complicated. &lt;/P&gt;

&lt;P&gt;Second, Splunk orders events, and &lt;CODE&gt;transaction&lt;/CODE&gt; makes some assumptions about that order. Your &lt;CODE&gt;dedup&lt;/CODE&gt; command was changing the default order. I wouldn't do that.&lt;/P&gt;

&lt;P&gt;Third, I simplified and combined a few steps.&lt;/P&gt;

&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="nodecheck" 
| rex "System (?&amp;lt;upordown&amp;gt;(?:Up|Down))" 
| dedup upordown consecutive=true
| transaction startswith="System Down" endswith="System Up" 
| eval Outage_Minutes=ceiling(duration/60) 
| eval DownTimeStart = strftime(_time,"%x %X")
| table DownTimeStart Outage_Minutes 
| addcoltotals labelfield=Outage_Minutes label="Total"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Mar 2014 23:24:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/transaction-endswith-usage/m-p/195477#M56352</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-03-19T23:24:36Z</dc:date>
    </item>
  </channel>
</rss>

