Splunk Search

Ingest actions and base64 decode

_olivier_
Path Finder

Hi splunkers,

I need to decode base64 fields before indexing them.

I found a very old post with no good proposal for this need : Solved: Re: Anybody have an idea for base64 decoding of fi... - Splunk Community

 

Does anybody has set base64 decode , maybe with ingest actions ?

 

Thank you.

Labels (2)
Tags (2)
0 Karma

tscroggins
Influencer

Hi @_olivier_,

Search-time base64 decoding is common, but depending on the context and underlying type of the encoded data, it may be possible to decode it at index-time using transforms, rulesets (ingest actions), and creative sequencing or routing.

How is the field data represented in _raw? Indexed (cooked) extractions? JSON? Key-value pairs? Delimiter and position?

What does the base64 octet stream represent? UTF-8 or another Unicode variant? CP437? ASCII? 8859-1? An EBCDIC variant? Binary data? An arbitrary MIME type? More than one of the preceding options?

@livehybrid's suggestion is a good one, and there are several examples of creative use of unarchive_cmd here on the community, but this would be a batch-like option. Scripted and modular inputs can also do the work.

0 Karma

livehybrid
SplunkTrust
SplunkTrust

Hi @_olivier_ 

Im not aware of a way to do this using Ingest Action (or INGEST_EVAL) specifically, but you could explore the unarchive_cmd in props.conf (https://help.splunk.com/en/splunk-enterprise/administer/admin-manual/10.0/configuration-file-referen...) which is intended to pass the data into a script/file as its ingested and can be used to unarchive tarballs (for example) but you could use a simple python script to take the input and base64 decode it, returning the decoded data to stdout for ingestion.

Is it the entire event that is base64?

You might also want to check out https://community.splunk.com/t5/Getting-Data-In/What-s-the-trick-to-get-unarchive-cmd-to-work-for-a-...

🌟 Did this answer help you? If so, please consider:

  • Adding karma to show it was useful
  • Marking it as the solution if it resolved your issue
  • Commenting if you need any clarification

Your feedback encourages the volunteers in this community to continue contributing

0 Karma
Get Updates on the Splunk Community!

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...