Cryptographic
Cryptographic functions return hashes in bytes, so you need to convert your bytes to a Base64-encoded string to send your data to a destination. See the base64_encode scalar function.
md5
This function computes and returns the MD5 hash of a byte value X. Because this function takes bytes
as its input, first use the to_bytes
conversion function to convert your string into a byte string.
- Function Input
- bytes
- Function Output
- bytes
SPL2 examples
...| eval hashed_bytes_md5=md5(to_bytes("hash-me"));
sha1
This function computes returns the secure hash of a byte value X based on the FIPS compliant SHA-1 hash function. Because this function takes bytes
as its input, first use the to_bytes
conversion function to convert your string into a byte string.
- Function Input
- bytes
- Function Output
- bytes
SPL2 examples
hashed_bytes_sha1=sha1(to_bytes("hash-me"));
sha256
This function computes and returns the secure hash of a byte value X based on the FIPS compliant SHA-256 hash function. Because this function takes bytes
as its input, first use the to_bytes
conversion function to convert your string into a byte string.
- Function Input
- bytes
- Function Output
- bytes
SPL2 examples
...| eval hashed_bytes_sha256=sha256(to_bytes("hash-me"));
sha512
This function computes and returns the secure hash of a byte value X based on the FIPS compliant SHA-512 hash function. Because this function takes bytes
as its input, first use the to_bytes
conversion function to convert your string into a byte string.
- Function Input
- bytes
- Function Output
- bytes
SPL2 examples
...| eval hashed_bytes_sha512=sha512(to_bytes("hash-me"));
Conversion | Date and Time |
This documentation applies to the following versions of Splunk® Data Stream Processor: 1.1.0
Feedback submitted, thanks!