Create consistent hashes (fingerprints) of one or more fields and store the result in a new field.
This can e.g. be used to create consistent document ids when inserting events into Elasticsearch, allowing events in Logstash to cause existing documents to be updated rather than new documents to be created.
|
Note
|
When the target option is set to UUID the result won’t be
a consistent hash but a random
UUID.
To generate UUIDs, prefer the {logstash-ref}/plugins-filters-uuid.html[uuid filter].
|
This plugin supports the following configuration options plus the [plugins-filters-fingerprint-common-options] described later.
| Setting | Input type | Required |
|---|---|---|
No |
||
No |
||
No |
||
No |
||
string, one of |
Yes |
|
No |
||
No |
Also see [plugins-filters-fingerprint-common-options] for a list of options supported by all filter plugins.
-
Value type is boolean
-
Default value is
false
When set to true, the SHA1, SHA256, SHA384, SHA512 and MD5 fingerprint methods will produce
base64 encoded rather than hex encoded strings.
-
Value type is boolean
-
Default value is
false
When set to true and method isn’t UUID or PUNCTUATION, the
plugin concatenates the names and values of all fields given in the
source option into one string (like the old checksum filter) before
doing the fingerprint computation. If false and multiple source
fields are given, the target field will be an array with fingerprints
of the source fields given.
-
Value type is boolean
-
Default value is
false
When set to true and method isn’t UUID or PUNCTUATION, the
plugin concatenates the names and values of all fields of the event
into one string (like the old checksum filter) before doing the
fingerprint computation. If false and at least one source field is
given, the target field will be an array with fingerprints of the
source fields given.
-
Value type is string
-
There is no default value for this setting.
When used with the IPV4_NETWORK or IPV6_NETWORK method fill in the subnet prefix length.
With other methods, optionally fill in the HMAC key.
-
This is a required setting.
-
Value can be any of:
SHA1,SHA256,SHA384,SHA512,MD5,MURMUR3,IPV4_NETWORK,IPV6_NETWORK,UUID,PUNCTUATION -
Default value is
"SHA1"
The fingerprint method to use.
If set to SHA1, SHA256, SHA384, SHA512, or MD5 and a key is set,
the cryptographic hash function with the same name will be used to generate
the fingerprint. When a key set, the keyed-hash (HMAC) digest function will
be used.
If set to MURMUR3 the non-cryptographic MurmurHash function will be used.
If set to IPV4_NETWORK the input data needs to be a IPv4 address and
the hash value will be the masked-out address using the number of bits
specified in the key option. For example, with "1.2.3.4" as the input
and key set to 16, the hash becomes "1.2.0.0".
If set to IPV6_NETWORK the input data needs to be a IPv6 address and
the hash value will be the masked-out address using the number of bits
specified in the key option. For example, with "2001:db8:85a3::8a2e:370:7334" as the input
and key set to 112, the hash becomes "2001:db8:85a3::8a2e:370:0".
If set to PUNCTUATION, all non-punctuation characters will be removed
from the input string.
If set to UUID, a
UUID will
be generated. The result will be random and thus not a consistent hash.
-
Value type is array
-
Default value is
"message"
The name(s) of the source field(s) whose contents will be used
to create the fingerprint. If an array is given, see the
concatenate_sources option.
-
Value type is string
-
Default value is
"fingerprint"
The name of the field where the generated fingerprint will be stored. Any current contents of that field will be overwritten.