Splunk Search

Base64 Search decoder Not Working on all fields

SD-SPL-4498
Observer

Hi All,

So I've created the logic below to decode base64. Other discussions on this topic give possible solutions but only work when what has been encoded is smaller in size because of use of list in their stats command.

My Logic Looks like this:

 

 

| eval time=_time | appendpipe [ | eval converts=split(encoded,"") | mvexpand converts | lookup base64conversion.csv index as converts OUTPUT value as base64bin | table encoded, base64bin, time | mvcombine base64bin | eval combined=mvjoin(base64bin,"") | rex field=combined "(?<asciibin>.{8})" max_match=0 | mvexpand asciibin | lookup base64conversion.csv index as asciibin OUTPUT value as outputs | table encoded, outputs, time | mvcombine outputs | eval decoded=mvjoin(outputs,"") | table encoded, decoded, time ] | selfjoin time 

 

 

And looks like this in a test environment:

SDSPL4498_0-1701355710054.png

This is partially taken from other people's work but so some of it may be familiar to other discussions.

My issue is when put into a larger search, it doesn't work for all values, especially the seemingly longer ones. I can't show it in action unfortunately but if you have a number of encoded commands to run it against it will only do it for one of them. I thought this might be because the self join for time is not entirely unique but I'm starting to think it's because I'm not using a stats command before the appendpipe to group by encoded, even when I do that though it still doesn't work.

The lookup I'm using is based on the one discussed here:
https://community.splunk.com/t5/Splunk-Search/base64-decoding-in-search/m-p/27572
At this point I will likely just install an app if no one can resolve this.

I thought I'd ask to get other people's points of view, any help would be much appreciated.

Labels (3)
0 Karma

isoutamo
SplunkTrust
SplunkTrust

Hi

any reason why you don't want to use this https://splunkbase.splunk.com/app/5565 ?

r. Ismo

0 Karma

SD-SPL-4498
Observer

Ah interesting, I hadn't seen that specific one before but had seen others in a similar vein.

My main hope was to not have to install any new apps as I'm working for a client and it'd create more work keeping it up to date, plus I thought a macro (what I was hoping to turn it into) could be easily transferred anywhere.

But I think maybe using python/apps is the best bet, has a lot more features and just works better, with a lot more error checking possible.

0 Karma
Get Updates on the Splunk Community!

Earn a $35 Gift Card for Answering our Splunk Admins & App Developer Survey

Survey for Splunk Admins and App Developers is open now! | Earn a $35 gift card!      Hello there,  Splunk ...

Continuing Innovation & New Integrations Unlock Full Stack Observability For Your ...

You’ve probably heard the latest about AppDynamics joining the Splunk Observability portfolio, deepening our ...

Monitoring Amazon Elastic Kubernetes Service (EKS)

As we’ve seen, integrating Kubernetes environments with Splunk Observability Cloud is a quick and easy way to ...