<?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: Transaction trouble with ping events... in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Transaction-trouble-with-ping-events/m-p/56813#M13909</link>
    <description>&lt;P&gt;by the way, the test data I provided originally was on a Windows system, and the actual data is on Linux... hence the difference in the syntax&lt;/P&gt;</description>
    <pubDate>Tue, 22 May 2012 10:27:22 GMT</pubDate>
    <dc:creator>MHibbin</dc:creator>
    <dc:date>2012-05-22T10:27:22Z</dc:date>
    <item>
      <title>Transaction trouble with ping events...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-trouble-with-ping-events/m-p/56809#M13905</link>
      <description>&lt;P&gt;Hi there, &lt;/P&gt;

&lt;P&gt;I am trying to solve a problem with some ping events (not parsed, just literally the output from recursive pinging (single ping count)). The problem is as follows:&lt;/P&gt;

&lt;P&gt;I need to create a field that states how long an interface/IP address is unavailable (i.e. all the time it has 100% loss rate, opposed to 0%). So this would be from the point a first failed ping (i.e. 100% loss) to point of the next successful ping (i.e. 0% ping). I have tried to do this with transaction, as it outputs the duration field, but I can't seem to get anything right.&lt;/P&gt;

&lt;P&gt;I was wondering if anyone could point me in the right direction.&lt;/P&gt;

&lt;P&gt;My events look similar to this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Pinging 192.168.56.101 with 1 bytes of data:
Reply from 192.168.56.101: bytes=1 time&amp;lt;1ms TTL=64
Ping statistics for 192.168.56.101:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Pinging 192.168.56.101 with 1 bytes of data:
Reply from 192.168.56.101: bytes=1 time&amp;lt;1ms TTL=64
Ping statistics for 192.168.56.101:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Pinging 192.168.56.101 with 1 bytes of data:
Request timed out.
Ping statistics for 192.168.56.101:
    Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),

Pinging 192.168.56.101 with 1 bytes of data:
Request timed out.
Ping statistics for 192.168.56.101:
    Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),

Pinging 192.168.56.101 with 1 bytes of data:
Request timed out.
Ping statistics for 192.168.56.101:
    Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),

Pinging 192.168.56.101 with 1 bytes of data:
Request timed out.
Ping statistics for 192.168.56.101:
    Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),

Pinging 192.168.56.101 with 1 bytes of data:
Reply from 192.168.56.101: bytes=1 time&amp;lt;1ms TTL=64
Ping statistics for 192.168.56.101:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The time field is the time of indexing.&lt;/P&gt;

&lt;P&gt;Thanks in advance,&lt;/P&gt;

&lt;P&gt;MHIbbin&lt;/P&gt;</description>
      <pubDate>Mon, 21 May 2012 18:17:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-trouble-with-ping-events/m-p/56809#M13905</guid>
      <dc:creator>MHibbin</dc:creator>
      <dc:date>2012-05-21T18:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction trouble with ping events...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-trouble-with-ping-events/m-p/56810#M13906</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=ping | 
rex "Pinging (?&amp;lt;ip&amp;gt;\S+)" |
rex "\((?&amp;lt;loss&amp;gt;\d+)% loss\)" |
sort ip _time |
streamstats current=false last(ip) as lastIP last(loss) as lastLoss |
where not (loss=100 and lastLoss=100 and lastIP=ip) | 
transaction ip startswith="(100% loss)" endswith="(0% loss)" | 
table ip duration
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It may not do exactly what you want,but I think you will be on the right track. Here is the problem with the transaction command: when you specify that it starts with 100% loss, then repeated 100% losses create many transactions - not what you want. So what I did:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;made sure that I had fields defined for the ip and the loss&lt;/LI&gt;
&lt;LI&gt;captured the ip and loss from the previous event&lt;/LI&gt;
&lt;LI&gt;used the where command to eliminate successive events that had the same ip and 100% loss&lt;/LI&gt;
&lt;LI&gt;used the transaction command to group the events using the ip address and the loss as criteria&lt;/LI&gt;
&lt;LI&gt;display the ip address and duration&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;There is more that you could do. For example, you could count the number of outages, average duration and overall down time by ip - just substitute the following for the table command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;stats count as NumberOfOutages avg(duration) as AverageOutage sum(duration) as TotalDowntime by ip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps. If it doesn't work, please comment on the answer - it could just be a typo. I couldn't really test this before posting.&lt;/P&gt;</description>
      <pubDate>Mon, 21 May 2012 18:57:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-trouble-with-ping-events/m-p/56810#M13906</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-05-21T18:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction trouble with ping events...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-trouble-with-ping-events/m-p/56811#M13907</link>
      <description>&lt;P&gt;Thanks very much for the help.&lt;/P&gt;

&lt;P&gt;I have modified what you have done, which I think has worked to meet my needs... I will update this tomorrow is it works (when I will have access to the actual data) rather than just my test data.&lt;/P&gt;

&lt;P&gt;Thanks again, &lt;/P&gt;

&lt;P&gt;Matt&lt;/P&gt;</description>
      <pubDate>Mon, 21 May 2012 21:46:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-trouble-with-ping-events/m-p/56811#M13907</guid>
      <dc:creator>MHibbin</dc:creator>
      <dc:date>2012-05-21T21:46:40Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction trouble with ping events...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-trouble-with-ping-events/m-p/56812#M13908</link>
      <description>&lt;P&gt;I'm not sure if I still need to use streamstats, but this seems to deliver what I need...&lt;/P&gt;

&lt;P&gt;sourcetype="ping" | streamstats last(hostIP) as lasthostIP last(pcktsLst) as lastloss  | transaction keepevicted=true hostIP startswith="0% packet loss" | stats sum(duration) by hostIP&lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2012 10:25:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-trouble-with-ping-events/m-p/56812#M13908</guid>
      <dc:creator>MHibbin</dc:creator>
      <dc:date>2012-05-22T10:25:06Z</dc:date>
    </item>
    <item>
      <title>Re: Transaction trouble with ping events...</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Transaction-trouble-with-ping-events/m-p/56813#M13909</link>
      <description>&lt;P&gt;by the way, the test data I provided originally was on a Windows system, and the actual data is on Linux... hence the difference in the syntax&lt;/P&gt;</description>
      <pubDate>Tue, 22 May 2012 10:27:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Transaction-trouble-with-ping-events/m-p/56813#M13909</guid>
      <dc:creator>MHibbin</dc:creator>
      <dc:date>2012-05-22T10:27:22Z</dc:date>
    </item>
  </channel>
</rss>

