Software /
code /
prosody-modules
Diff
misc/mtail/prosody.mtail @ 5856:75dee6127829 draft
Merge upstream
author | Trần H. Trung <xmpp:trần.h.trung@trung.fun> |
---|---|
date | Tue, 06 Feb 2024 18:32:01 +0700 |
parent | 5671:c217f4edfc4f |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/misc/mtail/prosody.mtail Tue Feb 06 18:32:01 2024 +0700 @@ -0,0 +1,13 @@ +counter prosody_log_messages by level + +/^(?P<date>(?P<legacy_date>\w+\s+\d+\s+\d+:\d+:\d+)|(?P<rfc3339_date>\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d+[+-]\d{2}:\d{2})) (?P<sink>\S+)\s(?P<loglevel>\w+)\s(?P<message>.*)/ { + 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]++ + } +}