Log transformations
This page explains what log message transformations are available in Aidbox
What is log transformation?
Transformation is the tool used to modify and/or filter log messages on the fly according to the rules defined in the Aidbox configuration.
How transformation can be activated
To active transformations on an appender define the transformation and add it to the appender. In the example below there are two transformation applied to the :qb/q
log messages and aidbox.log/ignore
transformation applied to the :w/resp
messages.
aidbox.log/ignore
To ignore the all the messages related to a certain type use built-in aidbox.log/ignore
transformation. In the example below all the :w/resp
(http response) messages are skipped.
:filter
Decides whether to omit a log message. It compares the threshold value with the specified path log value.
This example transformation skips log messages where the d
property in a message is lower than 100.
Parameters
:op
defines the operation::min
skips a message when threshold is lower than specified path value:max
skips a message when threshold is greater than specified path value
:value
is the threshold:path
specifies the path in the message where the desired value is held
:trim
Overwrites the given path value with the sub-string function.
This example transformation reduces the length of the :sql
string if it is longer than 50 symbols.
Parameters
:length
defines the maximum allowed string length:path
specifies where the desired string should be taken from
:dissoc
Removes the given keys set from the root of the log message.
This transformation remove the key :db_prm
and its values from the log message.
Parameters
:dissoc
itself is an array of prohibited root keys.
:select-keys
Takes defined keys from the root of the log message.
This transformation omits all the keys in a log messaged except: :ev
, :op
, :sql
and :d
.
Parameters
:select-keys
itself is an array of whitelisted root keys.
Last updated