On 23/08/2019 13:32, David Lang wrote:
On Fri, 23 Aug 2019, Brian Candler wrote:
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.
so it sounds like what you need is for a hash function to be
introduced, so that you can take the reconstructed rule, hash it,
truncate the hash and do whatever you want with it.
Yes, it certainly would be convenient to have the hash stored against
each rule, so it doesn't have to be recalculated each time. In the mean
time, I could use the filename and line number as a lookup into a cache
of hashes.
Now looking at python-liblognorm, but unfortunately it needs work to go
to python3 and/or liblognorm 2.x
_______________________________________________
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.