From c1b78468a21c49a7094c790ea6ef8c4b149e8eaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Dahlmo-Lerb=C3=A6k?= Date: Fri, 25 Jan 2019 18:57:21 +0100 Subject: [PATCH] Add support for ping output with error counter --- pingparser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pingparser.py b/pingparser.py index 1ab9941..3314555 100755 --- a/pingparser.py +++ b/pingparser.py @@ -27,7 +27,7 @@ # This one works on OS X output which includes the percentage in 0.0% format # https://regex101.com/r/nmjQzI/2 -rslt_matcher = re.compile(r'(\d+) packets transmitted, (\d+) (?:packets )?received, (\d+\.?\d*)% packet loss') +rslt_matcher = re.compile(r'(\d+) packets transmitted, (\d+) (?:packets )?received, (?:\+\d+ errors, )?(\d+\.?\d*)% packet loss') # Pull out round-trip min/avg/max/stddev = 49.042/49.042/49.042/0.000 ms minmax_matcher = re.compile(r'(\d+.\d+)/(\d+.\d+)/(\d+.\d+)/(\d+.\d+)')