Back to Elasticsearch

Fingerprint processor [fingerprint-processor]

docs/reference/enrich-processor/fingerprint-processor.md

9.4.02.8 KB
Original Source

Fingerprint processor [fingerprint-processor]

Computes a hash of the document’s content. You can use this hash for content fingerprinting.

$$$fingerprint-options$$$

NameRequiredDefaultDescription
fieldsyesn/aArray of fields to include in the fingerprint. For objects, the processor hashes both the field key andvalue. For other fields, the processor hashes only the field value.
target_fieldnofingerprintOutput field for the fingerprint.
saltno<none>Salt value for the hash function.
methodnoSHA-1The hash method used tocompute the fingerprint. Must be one of MD5, SHA-1, SHA-256, SHA-512, orMurmurHash3.
ignore_missingnofalseIf true, the processorignores any missing fields. If all fields are missing, the processor silentlyexits without modifying the document.
descriptionno-Description of the processor. Useful for describing the purpose of the processor or its configuration.
ifno-Conditionally execute the processor. See Conditionally run a processor.
ignore_failurenofalseIgnore failures for the processor. See Handling pipeline failures.
on_failureno-Handle failures for the processor. See Handling pipeline failures.
tagno-Identifier for the processor. Useful for debugging and metrics.

Example [fingerprint-processor-ex]

The following example illustrates the use of the fingerprint processor:

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:

console-result
{
  "docs": [
    {
      "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","_version":"-3","_ingest":{"timestamp":$body.docs.0.doc._ingest.timestamp},/]