[syslog-ng] [PATCH] tfhash: New template function to calculate the SHA1 of its input

Jakub Jankowski shasta at toxcorp.com
Fri Aug 3 20:13:19 CEST 2012


On 2012-08-03, Peter Gyongyosi wrote:

> tfhash: New template function to calculate the SHA1 of its input
>
> This patch adds a new template function called $(hash) which can be used
> to calculate the SHA1 hash of its inputs. As it uses the SHA1() function from
> OpenSSL, it is only available if syslog-ng is compiled using --enable-ssl.
>
> One use case for it can be when you'd like to anonymize sensitive parts of 
> the
> log message (eg. the user name) you parsed out using patterndb before storing
> or forwarding it for further analysis but would like to retain the ability to
> correlate messages along this value.

I like this very much! Another use case would be to use $(hash) along with 
$(substr) to "shard" logs across multiple storage points.

I'd love to see $(hash) with an (optional?) argument specifying the digest 
algorithm to use, but even with just SHA-1 it's really cool (and simple).



-- 
Jakub Jankowski|shasta at toxcorp.com|http://toxcorp.com/
GPG: FCBF F03D 9ADB B768 8B92 BB52 0341 9037 A875 942D


More information about the syslog-ng mailing list