base64Decode Search Operator
The base64Decode
operator takes a base64 string and converts it to ASCII or non-ASCII string. Input must be a valid base64 string. Invalid input is returned unaltered.
Syntaxâ
base64Decode("<string>"[, "<encoding>"]) as <field>
base64Decode(<string_field>[, "<encoding>"]) as <field>
Supported encodingsâ
- US-ASCII
- UTF-8 (default)
- UTF-16
- UTF-16BE
- UTF-16LE
- UTF-32
- UTF-32BE
- UTF-32LE
Examplesâ
The following example returns V
with a value of http://codec.apache.org/commmons
:
| base64Decode("aHR0cDovL2NvZGVjLmFwYWNoZS5vcmcvY29tbW1vbnM=") as V
The following example returns V
with a value of This is a test string
:
| base64Decode("VABoAGkAcwAgAGkAcwAgAGEAIAB0AGUAcwB0ACAAcwB0AHIAaQBuAGcA", "UTF-16LE") as V
The Base64Decode function supports decoding non-ASCII characters in addition to ASCII. The following example returns V
with a value of ăăă㨠ăăăăžă
:
| base64Decode("44GC44KK44GM44GoIOOBlOOBluOBhOOBvuOBmQ==") as V
Make sure that the decoding format you are using matches the one you used for encoding.