Skip to main content

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

note

Make sure that the decoding format you are using matches the one you used for encoding.

Status
Legal
Privacy Statement
Terms of Use

Copyright Š 2024 by Sumo Logic, Inc.