<?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 How to track application startup time? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-track-application-startup-time/m-p/143763#M39964</link>
    <description>&lt;P&gt;I have an application log that has two log lines I'm interested in trending.&lt;/P&gt;

&lt;P&gt;The first line is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;timestamp Application is Starting up
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The second line is&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;timestamp Application is Ready
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'd like to :&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Be able to search for these pairs (transactions?)&lt;/LI&gt;
&lt;LI&gt;Run a report that will show me T2(Ready)-T1(Starting) over time.  In other words - I want to be able to see if the startup time is getting longer, or if there is a particular instance where the startup time is abnormally long.&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Note: The second log line does not necessarily immediately follow the first.  It is likely that there are other log messages in between.&lt;/P&gt;</description>
    <pubDate>Fri, 25 Apr 2014 20:12:53 GMT</pubDate>
    <dc:creator>thesteve</dc:creator>
    <dc:date>2014-04-25T20:12:53Z</dc:date>
    <item>
      <title>How to track application startup time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-track-application-startup-time/m-p/143763#M39964</link>
      <description>&lt;P&gt;I have an application log that has two log lines I'm interested in trending.&lt;/P&gt;

&lt;P&gt;The first line is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;timestamp Application is Starting up
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The second line is&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;timestamp Application is Ready
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'd like to :&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Be able to search for these pairs (transactions?)&lt;/LI&gt;
&lt;LI&gt;Run a report that will show me T2(Ready)-T1(Starting) over time.  In other words - I want to be able to see if the startup time is getting longer, or if there is a particular instance where the startup time is abnormally long.&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Note: The second log line does not necessarily immediately follow the first.  It is likely that there are other log messages in between.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Apr 2014 20:12:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-track-application-startup-time/m-p/143763#M39964</guid>
      <dc:creator>thesteve</dc:creator>
      <dc:date>2014-04-25T20:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to track application startup time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-track-application-startup-time/m-p/143764#M39965</link>
      <description>&lt;P&gt;The following search command yielded the results I was looking for:&lt;/P&gt;

&lt;P&gt;index="myIndex" sourcetype="mySourceType" | transaction startswith="Application is Starting up" endswith="Application is Ready" | timechart avg(duration)&lt;/P&gt;

&lt;P&gt;The search itself groups all of the log entries between start and end, and automatically calculates the duration from beginning to end.  I did have to add the duration field to the results list by clicking the arrow on the left of the search result row and selecting the field to see it.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Apr 2014 20:42:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-track-application-startup-time/m-p/143764#M39965</guid>
      <dc:creator>thesteve</dc:creator>
      <dc:date>2014-04-25T20:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to track application startup time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-track-application-startup-time/m-p/143765#M39966</link>
      <description>&lt;P&gt;Hi thesteve,&lt;/P&gt;

&lt;P&gt;this is completely un-tested and I don't know if this will work, but you could try &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0.3/SearchReference/Streamstats"&gt;streamstats&lt;/A&gt; for this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;YourBaseSearchHere | streamstats current=f last(eval(if(match(_raw, "Application is Starting up"), _time , null() ))) AS start_time | eval ready_time=if(match(_raw, "Application is Ready"), _time, null() ) | eval duration=ready_time-start_time 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm not sure about the eval-if-match thingy, this just came up by ready the docs about &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0.3/SearchReference/CommonEvalFunctions"&gt;eval&lt;/A&gt;....so this could also fails here, but &lt;CODE&gt;streamstats&lt;/CODE&gt; is a good way to go. Also, the &lt;CODE&gt;duration&lt;/CODE&gt; time would be in second format and probably needs some reformatting using &lt;CODE&gt;strftime&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Fri, 25 Apr 2014 20:56:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-track-application-startup-time/m-p/143765#M39966</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-04-25T20:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to track application startup time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-track-application-startup-time/m-p/143766#M39967</link>
      <description>&lt;P&gt;That's the obvious one, nice &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
Could you please try my search as well, just curious if this will work ...&lt;/P&gt;</description>
      <pubDate>Fri, 25 Apr 2014 20:58:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-track-application-startup-time/m-p/143766#M39967</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-04-25T20:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to track application startup time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-track-application-startup-time/m-p/143767#M39968</link>
      <description>&lt;P&gt;It didn't work for me.  I have "Application is Starting up" and "Application child is Starting up" messages, so I'm wondering if that might be a problem.  In either instance, using your search I don't see any duration values.  I appreciate the insight though.  I'm going to look into streamstats a bit more now.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Apr 2014 22:58:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-track-application-startup-time/m-p/143767#M39968</guid>
      <dc:creator>thesteve</dc:creator>
      <dc:date>2014-04-25T22:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to track application startup time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-track-application-startup-time/m-p/143768#M39969</link>
      <description>&lt;P&gt;As long as you're only interested in the duration I recommend throwing out the non-ready and non-startup events early:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="myIndex" sourcetype="mySourceType" ("Application is Starting up" OR "Application is Ready") | transaction ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That potentially saves your Splunk instances a lot of work building up huge transactions.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Apr 2014 23:30:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-track-application-startup-time/m-p/143768#M39969</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-04-25T23:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to track application startup time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-track-application-startup-time/m-p/143769#M39970</link>
      <description>&lt;P&gt;Great idea!  Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 26 Apr 2014 07:26:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-track-application-startup-time/m-p/143769#M39970</guid>
      <dc:creator>thesteve</dc:creator>
      <dc:date>2014-04-26T07:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to track application startup time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-track-application-startup-time/m-p/143770#M39971</link>
      <description>&lt;P&gt;update: just to add, the &lt;CODE&gt;last(eval(if(match(...&lt;/CODE&gt; works well &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Apr 2014 12:14:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-track-application-startup-time/m-p/143770#M39971</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-04-29T12:14:47Z</dc:date>
    </item>
  </channel>
</rss>

