fluent-plugin-sql_fingerprint
A Fluent filter plugin to convert sql to sql's fingerprint.
Requirements
Fluentd >= v0.14
Install
gem install fluent-plugin-sql_fingerprint
Configuration Example
<filter tag.dummy.*>
type sql_fingerprint
fingerprint_tool_path /usr/bin/pt-fingerprint
</filter>
sample
record before filter
{
"sql": "SELECT * FROM demo WHERE record = 'AAA';"
}
record after filter
{
"sql": "SELECT * FROM demo WHERE record = 'AAA';",
"fingerprint": "select * from demo where record = ?"
}
Parameters
-
fingerprint_tool_path (required)
Tool path which generates fingerpint. It must input from standard input and output to standard output. Ex. pt-fingerprint (see https://www.percona.com/doc/percona-toolkit/2.2/index.html)
-
target_key
The key which was passed to standard input of fingerprint_tool. Default is
sql
. -
added_key
The key which was added to new record that holds fingerprint generated by fingerpinrt_tool. Default is
fingerprint
.
Copyright
Copyright (c) 2015 Takahiro Kikumoto. See LICENSE for details.