From 21c71649f641e1dd13da123d2f8c28bada63c3cc Mon Sep 17 00:00:00 2001 From: Jesse Portnoy Date: Tue, 18 Jul 2023 17:00:17 +0100 Subject: [PATCH] Add `ping` parser --- syntax_files/ping.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 syntax_files/ping.yaml diff --git a/syntax_files/ping.yaml b/syntax_files/ping.yaml new file mode 100644 index 0000000..3f98026 --- /dev/null +++ b/syntax_files/ping.yaml @@ -0,0 +1,27 @@ +filetype: ping + +detect: + filename: "\\.ping$" + header: "(^PING[[:space:]]+[\\S+])" + +rules: + # IP + - blue: "\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}" + # IP v6 + - blue: "(([0-9a-fA-F]{1,4})?\\:\\:?[0-9a-fA-F]{1,4})+" + # seq + - green: "icmp_seq=(\\d+)" + # ttl + - cyan: "ttl=(\\d+)" + # host + - yellow: "(?:[fF]rom|PING)\\s(\\S+)\\s" + - yellow: "--- (\\S+) ping statistics ---" + - cyan: "\\s([0-9\\.]+)\\/([0-9\\.]+)\\/([0-9\\.]+)\\/([0-9\\.]+) ms" + - cyan: "(min/avg/max/mdev)" + # ttl + - red: "time=([0-9\\.]+)\\s?ms" + # errors + - red: "DUP\\!" + - red: "(Destination Host Unreachable|100(\\.0)?% packet loss)" + - red: ".+unknown\\shost\\s(.+)" +