Class: Fluent::Plugin::PostgreSQLRedactor
- Inherits:
-
Filter
- Object
- Filter
- Fluent::Plugin::PostgreSQLRedactor
- Defined in:
- lib/fluent/plugin/filter_postgresql_redactor.rb
Instance Method Summary collapse
Instance Method Details
#filter(_tag, _time, record) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/fluent/plugin/filter_postgresql_redactor.rb', line 22 def filter(_tag, _time, record) statement = record[@input_key] return record unless statement normalized = PgQuery.normalize(statement) record[@fingerprint_key] = PgQuery.fingerprint(normalized) if @fingerprint_key record.delete(@input_key) record[@output_key] = truncate_query(record, normalized) record rescue PgQuery::ParseError record['pg_query_error'] = true record end |