On 23/08/2019 12:03, David Lang wrote:
2. I wondered what the best practice is for recording which rule
matched, e.g. for metrics ("this pattern matched N times").
-oaddRuleLocation is not stable if the rulebase changes. I can think
of a couple of options:
In current versions you can set it to output the rule that matched as
part of the output. I'd have to look at the docs to see exactly which
option that is
You can get the filename and line number with -oaddRuleLocation on the
CLI (or LN_CTXOPT_ADD_RULE_LOCATION in the API); or you can get a
reconstructed version of the rule itself using -oaddRule /
LN_CTXOPT_ADD_RULE.
What I was trying to say was, the line numbers are not ideal to record
in your database or to count, because if you insert or delete rules,
they change. Hence I was considering storing a truncated hash of the rule.
_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE
THAT.