Calculates a secure hash of a field for storing in the event. See hashMatch() on how to search for events using hashes. Bits can reduce the width of the output if desired to keep the resulting strings short.

Function Traits: Transformation

asstringoptional  The name of output field, defaults to the input field.
bitsintegeroptional256 Hash algorithm output bits to keep. Must be a multiple of 8.
field[a]stringrequired  The name of the field to hash.
hashstringoptionalsha256 Hash algorithm.
  Valid Valuessha256
replaceInRawstringbooleanoptional  Replace all substrings in @rawstring that has the input value with the hash too.
saltstringrequired  The name of the secret salt to use.

[a] The argument name field can be omitted.

The parameter name for field can be omitted; the following forms are equivalent:




hashRewrite() Examples

Replace the value in the ssn field with the hash of the existing value, also replacing it in @rawstring

hashRewrite(ssn, salt="salt1")