Skip to content

Commit

Permalink
Merge pull request #4795 from alltilla/qbittorrent-and-pihole-set-sev…
Browse files Browse the repository at this point in the history
…erity

`pihole-ftl()`: Use the new parsing of `set-severity()`
  • Loading branch information
MrAnno committed Jan 24, 2024
2 parents 8f87f60 + b35c38c commit 0fa3da3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
19 changes: 2 additions & 17 deletions scl/pihole/pihole.conf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ block parser pihole_ftl()
channel {
parser {
regexp-parser(
patterns('^\[([^ ]+ [^ ]+) [^ \]]+\] (FATAL:|ERR:|ERROR:|Error:|WARN:|WARNING:|Warning:|Notice:|INFO:|DEBUG:|) ?(?<MESSAGE>.*)')
patterns('^\[([^ ]+ [^ ]+) [^ \]]+\] (?:(FATAL|ERR|ERROR|Error|WARN|WARNING|Warning|Notice|INFO|DEBUG):|) ?(?<MESSAGE>.*)')
);
date-parser(
template("$1")
Expand All @@ -35,23 +35,8 @@ block parser pihole_ftl()

rewrite {
set("Pi-hole" value("APP"));
set-severity("$2" condition("$2" ne ""));
};

if ("$2" eq "") {
# No severity was found.
} elif (match("FATAL" value("2"))) {
rewrite { set-severity("emergency"); };
} elif (match("^(ERR|ERROR|Error):$" value("2"))) {
rewrite { set-severity("error"); };
} elif (match("^(WARN|WARNING|Warning):$" value("2"))) {
rewrite { set-severity("warning"); };
} elif (match("^(Notice):$" value("2"))) {
rewrite { set-severity("notice"); };
} elif (match("^(INFO):$" value("2"))) {
rewrite { set-severity("info"); };
} elif (match("^(DEBUG):$" value("2"))) {
rewrite { set-severity("debug"); };
} else {};
};
};

Expand Down
2 changes: 1 addition & 1 deletion scl/qbittorrent/qbittorrent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ block parser qbittorrent()
rewrite { set-severity("info"); };
} elif (match("N" value("1") type("string"))) {
rewrite { set-severity("notice"); };
} else {};
};
};
};

Expand Down

0 comments on commit 0fa3da3

Please sign in to comment.