remove unneeded (default) include, improved grp-regex (with negative lookahead for msg and remote_ip tokens)

This commit is contained in:
sebres 2026-11-02 16:52:48 +01:00
parent e5fdceffae
commit 533bbd93f7

View file

@ -8,11 +8,6 @@
# logtype = json (structured JSON format)
#
[INCLUDES]
# Load customizations if any available
after = authelia.local
[Definition]
# Log format: "file" (standard key-value text) or "json"
@ -27,12 +22,12 @@ journalmatch = _SYSTEMD_UNIT=authelia.service
[lt_file]
datepattern = {^LN-BEG}time="{DATE}"\s+
grp = (?:\w+=("(?:[^\\"]|\\.)*"|\S+)\s+)*
grp = (?:(?!msg|remote_ip)\w+=("(?:[^\\"]|\\.)*"|\S+)\s+)*
failregex = ^\s*%(grp)smsg="Unsuccessful \S+ authentication attempt by user '<F-USER>(?:[^\\']|\\.)*</F-USER>'[^"]*" %(grp)sremote_ip=<ADDR>
[lt_json]
datepattern = "time":"{DATE}"
grp = (?:"\w+":("(?:[^\\"]|\\.)*"|\S+),\s*)*
grp = (?:"(?!msg|remote_ip)\w+":("(?:[^\\"]|\\.)*"|\S+),\s*)*
failregex = ^{%(grp)s"msg":"Unsuccessful \S+ authentication attempt by user '<F-USER>(?:[^\\']|\\.)*</F-USER>'[^"]*",%(grp)s"remote_ip":"<ADDR>"
^{%(grp)s"remote_ip":"<ADDR>",%(grp)s"msg":"Unsuccessful \S+ authentication attempt by user '<F-USER>(?:[^\\']|\\.)*</F-USER>'[^"]*"