icon/x Created with Sketch.

Splunk Cookie Policy

We use our own and third-party cookies to provide you with a great online experience. We also use these cookies to improve our products and services, support our marketing campaigns, and advertise to you on our website and other websites. Some cookies may continue to collect information after you have left our website. Learn more (including how to update your settings) here.
Accept Cookie Policy

We are working on something new...

A Fresh New Splunkbase
We are designing a New Splunkbase to improve search and discoverability of apps. Check out our new and improved features like Categories and Collections. New Splunkbase is currently in preview mode, as it is under active development. We welcome you to navigate New Splunkbase and give us feedback.

Accept License Agreements

This app is provided by a third party and your right to use the app is in accordance with the license provided by that third-party licensor. Splunk is not responsible for any third-party apps and does not provide any warranty or support. If you have any questions, complaints or claims with respect to this app, please contact the licensor directly.

Thank You

Downloading Base64
SHA256 checksum (base64_11.tgz) 8acc1f2980e749b4be1481f7c53c30abb713d14bfa8b9b15092d47986cef1190 SHA256 checksum (base64_103.tgz) 9e4175c482076b1db1d4e52440aea562f9afb27be251b68da0a8663bab2cc061 SHA256 checksum (base64_100.tgz) dc032d7351f8c1c219d4ab718a463eb86592957d09e662cb85cb03ac9ed66243
To install your download
For instructions specific to your download, click the Details tab after closing this window.

Flag As Inappropriate

splunk

Base64

Splunk Cloud
This app has been archived. Learn more about app archiving.
This app is NOT supported by Splunk. Please read about what that means for you here.
Overview
Details
The base64 custom search command is a command that does Base64 encoding and decoding.

The base64 custom search command is a command that do Base64 encoding and decoding.

... | base64 field=your_field [action=(encode|decode)] [mode=(replace|append)] [suppress_error=(True|False)]
  • field : field to encode or decode.
  • action : encode (default) or decode the content. Optional.
  • mode : replace the existing field content (default) or create a new field named base64 (mode append). Optional.
  • suppress_error : do not raise errors if set to True. Optional, default to False.

Note on decoding:

While the input string can be anything for the encoding operation, it should respect the alphabet [a-zA-Z0-9/=] and its length should be a multiple of 4 while decoding. If the format is not respected, the command will throw errors (except if you set the flag suppress_error).

In the following example, we assume we are working on proxy/web logs and those will contains a field uri. This field will contains URI links and some of them will contains
an argument plop which refer to Base64 encoded data.

So, to get it working:

  • filter the results
  • extract the base64 content (command rex)
  • evaluate the length of the base64 content to avoid content with a wrong padding
  • decode the base64 content

Here is one way of doing it in Splunk:

... your search to get field 'uri' for example...

| fields uri

| rex field=uri "plop=(?<content_to_decode>[a-zA-Z0-9/=]*)”

| eval clength=len(content_to_decode)%4

| search clength=0

| base64 field=“content_to_decode" action=“decode" mode=“append"

History

v2.0

  • Avoid errors by adding padding
  • Less ambiguous escaped output
  • Optional charset when decoding
  • Lookups with default options
  • Return original event if input field does not exist
  • MIME decoding for base64 encoded MIME
  • Workaround for leading spaces

v1.1
- non printable characters are presented as hexadecimal when decoding (ex: base64=<%PDF\x00\x00).
v1.0
- Initial release

Release Notes

Version 1.1
Sept. 21, 2015
Version 1.0.3
Feb. 12, 2015
Version 1.0.0
Dec. 8, 2014
1,183
Installs
4,676
Downloads
Share Subscribe LOGIN TO DOWNLOAD

Subscribe Share

Are you a developer?

As a Splunkbase app developer, you will have access to all Splunk development resources and receive a 10GB license to build an app that will help solve use cases for customers all over the world. Splunkbase has 1000+ apps from Splunk, our partners and our community. Find an app for most any data source and user need, or simply create your own with help from our developer portal.

Follow Us:
Splunk, Splunk>,Turn Data Into Doing, Data-to-Everything, and D2E are trademarks or registered trademarks of Splunk Inc. in the United States and other countries. All other brand names,product names,or trademarks belong to their respective owners.