From 940c1e9381e289a4224987bddeeae52a3d23d770 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 24 Apr 2020 23:14:58 +0200 Subject: early-errors: get errors into array --- early-errors | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'early-errors') diff --git a/early-errors b/early-errors index ad871f6..eaee745 100644 --- a/early-errors +++ b/early-errors @@ -9,11 +9,12 @@ :global SendNotification; -:local ErrCount [ / log print count-only where topics~"error" ]; +:local Errors [ / log find where topics~"error" ]; +:local ErrCount [ :len $Errors ]; :if ($ErrCount > 0) do={ :local Message ("The log on " . $Identity . " contains " . $ErrCount . \ " errors after " . [ / system resource get uptime ] . " uptime.\n"); - :foreach Log in=[ / log find where topics~"error" ] do={ + :foreach Log in=$Errors do={ :local LogVal [ / log get $Log ]; :set Message ($Message . "\n" . [ :tostr ($LogVal->"topics") ] . \ " " . ($LogVal->"message")); -- cgit v1.2.3-70-g09d2