Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/reference/ingest/processors.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ include::processors/dot-expand.asciidoc[]
include::processors/drop.asciidoc[]
include::processors/enrich.asciidoc[]
include::processors/fail.asciidoc[]
include::processors/fingerprint.asciidoc[]
include::processors/foreach.asciidoc[]
include::processors/geoip.asciidoc[]
include::processors/grok.asciidoc[]
Expand Down
90 changes: 90 additions & 0 deletions docs/reference/ingest/processors/fingerprint.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
[role="xpack"]
[testenv="basic"]
[[fingerprint-processor]]
=== Fingerprint processor
++++
<titleabbrev>Fingerprint</titleabbrev>
++++

Computes a hash of the document's content. You can use this hash for
{wikipedia}/Fingerprint_(computing)[content fingerprinting].

[[fingerprint-options]]
.Fingerprint Options
[options="header"]
|======
| Name | Required | Default | Description
| `fields` | yes | n/a | Array of fields to include in
the fingerprint. For objects, the processor hashes both the field key and
value. For other fields, the processor hashes only the field value.
| `target_field` | no | `fingerprint` | Output field for the fingerprint.
| `salt` | no | <none> |
{wikipedia}/Salt_(cryptography)[Salt value] for the hash function.
| `method` | no | `SHA-1` | The cryptographic hash function used to
compute the fingerprint. Must be one of `MD5`, `SHA-1`, `SHA-256`, or `SHA-512`.
| `ignore_missing` | no | `false` | If `true`, the processor
ignores any missing `fields`. If all fields are missing, the processor silently
exits without modifying the document.

include::common-options.asciidoc[]
|======

[discrete]
[[fingerprint-processor-ex]]
===== Example

The following example illustrates the use of the fingerprint processor:

[source,console]
----
POST _ingest/pipeline/_simulate
{
"pipeline": {
"processors": [
{
"fingerprint": {
"fields": ["user"]
}
}
]
},
"docs": [
{
"_source": {
"user": {
"last_name": "Smith",
"first_name": "John",
"date_of_birth": "1980-01-15",
"is_active": true
}
}
}
]
}
----

Which produces the following result:

[source,console-result]
----
{
"docs": [
{
"doc": {
...
"_type": "_doc",
"_source": {
"fingerprint" : "WbSUPW4zY1PBPehh2AA/sSxiRjw=",
"user" : {
"last_name" : "Smith",
"first_name" : "John",
"date_of_birth" : "1980-01-15",
"is_active" : true
}
}
}
}
]
}
----
// TESTRESPONSE[s/\.\.\./"_index":"_index","_id":"_id","_ingest":{"timestamp":$body.docs.0.doc._ingest.timestamp},/]