<?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 find blocks where response time is 0 from ping data? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-blocks-where-response-time-is-0-from-ping-data/m-p/257450#M77117</link>
    <description>&lt;P&gt;Hi @dajomas&lt;/P&gt;

&lt;P&gt;Glad you got your expected output. Could you please resolve the post by clicking "Accept" directly below the answer that best helped solve your issue? Also, please be sure to comment below that answer with the final search you used get your expected results.&lt;/P&gt;</description>
    <pubDate>Mon, 18 Jul 2016 20:18:28 GMT</pubDate>
    <dc:creator>ppablo</dc:creator>
    <dc:date>2016-07-18T20:18:28Z</dc:date>
    <item>
      <title>How to find blocks where response time is 0 from ping data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-blocks-where-response-time-is-0-from-ping-data/m-p/257446#M77113</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;

&lt;P&gt;I receive ping data into my Splunk environment. Everything is filtered so that I can plot the response times in a nice graph.&lt;/P&gt;

&lt;P&gt;But what I would like to extract from this data are the blocks where the response time is 0 (which means there is no connection). I would like to retrieve the _time field for the first and the last event in that block so that I know during which intervals the connection is not available.&lt;/P&gt;

&lt;P&gt;Can anyone point me in the direction I should be looking at?&lt;/P&gt;

&lt;P&gt;Thanx!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2016 07:34:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-blocks-where-response-time-is-0-from-ping-data/m-p/257446#M77113</guid>
      <dc:creator>dajomas</dc:creator>
      <dc:date>2016-07-12T07:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to find blocks where response time is 0 from ping data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-blocks-where-response-time-is-0-from-ping-data/m-p/257447#M77114</link>
      <description>&lt;P&gt;You would need to explore &lt;A href="https://docs.splunk.com/Documentation/Splunk/6.4.1/SearchReference/Streamstats"&gt;streamstats&lt;/A&gt; search command.&lt;/P&gt;

&lt;P&gt;See these posts with similar requirements&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/48557/transaction-trouble-with-ping-events.html"&gt;https://answers.splunk.com/answers/48557/transaction-trouble-with-ping-events.html&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/129766/service-down-time-stats.html"&gt;https://answers.splunk.com/answers/129766/service-down-time-stats.html&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/240689/how-to-calculate-downtime-based-on-the-amount-of-r.html"&gt;https://answers.splunk.com/answers/240689/how-to-calculate-downtime-based-on-the-amount-of-r.html&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/311027/how-to-identity-each-start-stop.html"&gt;https://answers.splunk.com/answers/311027/how-to-identity-each-start-stop.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2016 18:00:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-blocks-where-response-time-is-0-from-ping-data/m-p/257447#M77114</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-07-12T18:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to find blocks where response time is 0 from ping data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-blocks-where-response-time-is-0-from-ping-data/m-p/257448#M77115</link>
      <description>&lt;P&gt;Try with the &lt;CODE&gt;autoregress&lt;/CODE&gt; command, then compare the previous and current values. Once you have that, you can add logic to group by blocks where current and previous is 0. One approach could like this psuedo code&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;.. | reverse | autoregress pingtime as prevvalue | where pingtime&amp;gt;0 AND prevalue=0 | streamstats range(_time) as duration | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.7/SearchReference/Autoregress"&gt;http://docs.splunk.com/Documentation/Splunk/6.1.7/SearchReference/Autoregress&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jul 2016 18:17:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-blocks-where-response-time-is-0-from-ping-data/m-p/257448#M77115</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-07-12T18:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to find blocks where response time is 0 from ping data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-blocks-where-response-time-is-0-from-ping-data/m-p/257449#M77116</link>
      <description>&lt;P&gt;Thanx to @somesoni2 and @sundareshr . &lt;BR /&gt;
Both your answers helped me reach my desired output.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2016 08:30:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-blocks-where-response-time-is-0-from-ping-data/m-p/257449#M77116</guid>
      <dc:creator>dajomas</dc:creator>
      <dc:date>2016-07-14T08:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to find blocks where response time is 0 from ping data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-blocks-where-response-time-is-0-from-ping-data/m-p/257450#M77117</link>
      <description>&lt;P&gt;Hi @dajomas&lt;/P&gt;

&lt;P&gt;Glad you got your expected output. Could you please resolve the post by clicking "Accept" directly below the answer that best helped solve your issue? Also, please be sure to comment below that answer with the final search you used get your expected results.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2016 20:18:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-blocks-where-response-time-is-0-from-ping-data/m-p/257450#M77117</guid>
      <dc:creator>ppablo</dc:creator>
      <dc:date>2016-07-18T20:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to find blocks where response time is 0 from ping data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-blocks-where-response-time-is-0-from-ping-data/m-p/257451#M77118</link>
      <description>&lt;P&gt;The scipt that generates the input records is:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;date
/bin/ping $1 -c1 -R -n -v
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The input records look like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Tue Jul 19 09:15:01 CEST 2016
PING 192.168.XXX.YYY (192.168.XXX.YYY) 56(124) bytes of data.
64 bytes from 192.168.XXX.YYY: icmp_seq=1 ttl=63 time=1.27 ms
RR:     192.168.XXA.YYA
        192.168.XXX.YYB
        192.168.XXX.YYY
        192.168.XXA.YYC
        192.168.XXA.YYA


--- 192.168.XXX.YYY ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 1.276/1.276/1.276/0.000 ms
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And the output I needed is found with the following search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="/var/log/ping/*" index="ping" sourcetype="ping" host=192.168.XXX.YYY PING 
 | fillnull 
 | reverse 
 | autoregress time as prevvalue 
 | search (time=0 AND prevvalue&amp;gt;0) OR (time&amp;gt;0 AND prevvalue=0)
 | autoregress time as time_1
 | autoregress _time as etime_1
 | autoregress prevvalue as prevvalue_1
 | eval etime = _time
 | eval secs = round((etime - etime_1) / 60) * 60
 | eval duration = tostring(secs,"duration")
 | rename etime as endtime, etime_1 as starttime
 | fieldformat starttime = strftime(starttime, "%Y-%m-%d %H:%M")
 | fieldformat endtime = strftime(endtime, "%Y-%m-%d %H:%M")
 | search endtime=* AND (prevvalue=0 AND time_1=0)
 | reverse
 | table starttime, endtime, duration
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And the result looks like this:&lt;BR /&gt;
&lt;IMG src="http://www.godfried.com/ping_gaps.PNG" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 07:21:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-blocks-where-response-time-is-0-from-ping-data/m-p/257451#M77118</guid>
      <dc:creator>dajomas</dc:creator>
      <dc:date>2016-07-19T07:21:50Z</dc:date>
    </item>
  </channel>
</rss>

