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) 5f7ccea9e48dae2f5cabeeb12dc95301906c4d55904ce318730ef042535055b8 SHA256 checksum (base64_103.tgz) 2055a2e5c51ca85548f13096c42c242059aa955b5e893614df926569f1122a6c SHA256 checksum (base64_100.tgz) eb467fe81a0c4ca8314695f609368162a8876a6b457cbb61a871a39bf99b98a0
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

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.