Redesign message format
[khatus.git] / src / awk / exe / monitor_errors.awk
index 13130cc..36fd534 100755 (executable)
@@ -1,10 +1,6 @@
-/^ERROR/ {
-    src = $2
-    # Not just using $3 for body - because body might contain a character
-    # identical to FS
-    len_line = length($0)
-    len_head = length($1 FS $2 FS)
-    len_body = len_line - len_head
-    body = substr($0, len_head + 1, len_body)
-    msg_out_ok_alert("hi", "ERROR_IN_" src, body)
+$3 == "error" {
+    delete msg
+    msg_in_parse(msg, $0)
+    subject = "ERROR_IN_" msg["node"] ":" msg["module"]
+    msg_out_alert_hi(subject, msg["line"])
 }
This page took 0.022548 seconds and 4 git commands to generate.