public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
From: Matthias Fischer <matthias.fischer@ipfire.org>
To: development@lists.ipfire.org
Subject: [PATCH] log.dat: Fix an error with 'monit' logging too much data.
Date: Fri, 21 Jan 2022 18:07:56 +0100	[thread overview]
Message-ID: <20220121170756.3466085-1-matthias.fischer@ipfire.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1047 bytes --]

Making the regex "non-greedy" fixes an error Jon found.

'monit' logged a whole line from '/var/log/messages' where it should only log the first part.

Reference:
https://www.ultraedit.com/support/tutorials-power-tips/ultraedit/non-greedy-perl-regex.html

Signed-off-by: Matthias Fischer <matthias.fischer(a)ipfire.org>
---
 html/cgi-bin/logs.cgi/log.dat | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/html/cgi-bin/logs.cgi/log.dat b/html/cgi-bin/logs.cgi/log.dat
index 0d6c6722a..3364b7bea 100644
--- a/html/cgi-bin/logs.cgi/log.dat
+++ b/html/cgi-bin/logs.cgi/log.dat
@@ -62,7 +62,7 @@ my %sections = (
         'ipfire' => '(ipfire: )',
         'ipsec' => '(ipsec_[\w_]+: |pluto\[.*\]: |charon: |vpnwatch: )',
         'kernel' => '(kernel: (?!DROP_))',
-        'monit' => '(monit\[.*\]: )',
+        'monit' => '(monit\[.*?\]: )',
         'ntp' => '(ntpd(?:ate)?\[.*\]: )',
 	'oinkmaster' => '(oinkmaster\[.*\]: )',
         'openvpn' => '(openvpnserver\[.*\]: |.*n2n\[.*\]: )',
-- 
2.25.1


             reply	other threads:[~2022-01-21 17:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-21 17:07 Matthias Fischer [this message]
2022-01-25 16:53 ` Peter Müller
2022-01-28 13:20 ` Bernhard Bitsch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220121170756.3466085-1-matthias.fischer@ipfire.org \
    --to=matthias.fischer@ipfire.org \
    --cc=development@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox