From 96dcde9a63638517aa0dc405ed5078682d23e842 Mon Sep 17 00:00:00 2001 From: Nick Marti Date: Tue, 17 Sep 2024 09:44:05 +0200 Subject: [PATCH] Fix awk script parsing of ERRORLOG for last entry UniqeID --- transform-alert-message.awk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/transform-alert-message.awk b/transform-alert-message.awk index 8befa6a..04e362a 100755 --- a/transform-alert-message.awk +++ b/transform-alert-message.awk @@ -107,7 +107,8 @@ BEGIN { # tag case "hostname": Hostname = substr($i, 2, length($i) - 3); FN = ""; break case "uri": Uri = substr($i, 2, length($i) - 3); FN = ""; break - case "unique_id": UniqueID = substr($i, 2, length($i) - 3); FN = ""; break + # This needs to remove 1 char more since it's the last entry and ends in "], instead of "] + case "unique_id": UniqueID = substr($i, 2, length($i) - 4); FN = ""; break case "msg": if ( substr($i, 1, 1) == "\"" ) { Msg = substr($i, 2, length($i) - 1)