hashRewrite() Query Function

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.

Parameters

Name

Type

Required

Default

Description

field

string

Yes

The name of the field to hash.

as

string

No

The name of output field, defaults to the input field.

replaceInRawstring

boolean

No

Replace all substrings in @rawstring that has the input value with the hash too.

salt

string

Yes

The name of the secret salt to use.

hash

string

No

sha256

Hash algorithm. Supported: sha256 and sha512.

bits

number

No

256

Hash algorithm output bits to keep. Must be a multiple of 8 in the range 8 - 512.

The implied parameter is field.

Examples

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

humio
hashRewrite(ssn, salt="salt1")