mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-19 19:40:41 +01:00
23 lines
681 B
Plaintext
23 lines
681 B
Plaintext
$IncludeConfig diag-common.conf
|
|
|
|
ruleset(name="stats") {
|
|
action(type="omfile" file="./rsyslog.out.stats.log")
|
|
}
|
|
|
|
module(load="../plugins/impstats/.libs/impstats" interval="2" severity="7" resetCounters="on" Ruleset="stats" bracketing="on")
|
|
|
|
template(name="outfmt" type="string" string="%msg% %$.increment_successful%\n")
|
|
|
|
dyn_stats(name="msg_stats" unusedMetricLife="1" maxCardinality="3")
|
|
|
|
set $.msg_prefix = field($msg, 32, 1);
|
|
|
|
if (re_match($.msg_prefix, "foo|bar|baz|quux|corge|grault")) then {
|
|
set $.increment_successful = dyn_inc("msg_stats", $.msg_prefix);
|
|
} else {
|
|
set $.increment_successful = -1;
|
|
}
|
|
|
|
action(type="omfile" file="./rsyslog.out.log" template="outfmt")
|
|
|