On This Page

Home / Search/ Language Reference/ Functions/ Scalar Functions/ Cryptographic Functions/encrypt

encrypt

The encrypt function encrypts data with a key managed by a Cribl Stream Worker Group.

For more information on how to set up encryption keys, see the Cribl Stream docs:

Syntax

encrypt(value, workerGroup, keyId)

Parameters

NameTypeRequiredDescription
valuestringYesA valid KQL expression. This is the data to encrypt.
workerGroupstringYesThe name of the Stream Worker Group that has the encryption key.
keyIdstringYesThe ID of the encryption key.

Returns

Returns the input data, encrypted using the specified key from the specified Stream Worker Group, encoded as a Base64 string.

Permissions

You need access to the Stream Worker Group that contains the encryption key.

Example

Encrypt a specific field (dstport), and export it to a Cribl Lake Dataset.

dataset="cribl_search_sample"
 | limit 1000
 | extend dstport = encrypt(dstport, <workerGroup>, <keyId>)
 | export to lake myLakeDataset