# HG changeset patch # User Kim Alvefur # Date 1694950590 -7200 # Node ID c217f4edfc4fbd718000bdab3d7dd158cf543cfd # Parent d4b97eaeb235253c76323b390018659d75d5ee9e misc/mtail: Start of an mtail config Stashing it here in case anyone wants to continue working on it. Currently it's only counting log messages by level. Due to the permissions set by systemd on Prosody logs, mtail never managed to start correctly until permissions were manually relaxed. diff -r d4b97eaeb235 -r c217f4edfc4f misc/mtail/prosody.mtail --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/misc/mtail/prosody.mtail Sun Sep 17 13:36:30 2023 +0200 @@ -0,0 +1,13 @@ +counter prosody_log_messages by level + +/^(?P(?P\w+\s+\d+\s+\d+:\d+:\d+)|(?P\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d+[+-]\d{2}:\d{2})) (?P\S+)\s(?P\w+)\s(?P.*)/ { + len($legacy_date) > 0 { + strptime($2, "Jan _2 15:04:05") + } + len($rfc3339_date) > 0 { + strptime($rfc3339_date, "2006-01-02T03:04:05-0700") + } + $loglevel != "" { + prosody_log_messages[$loglevel]++ + } +}