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 (2)
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!

Splunk Answers Content Calendar, June Edition

Get ready for this week’s post dedicated to Splunk Dashboards! We're celebrating the power of community by ...

What You Read The Most: Splunk Lantern’s Most Popular Articles!

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

See your relevant APM services, dashboards, and alerts in one place with the updated ...

As a Splunk Observability user, you have a lot of data you have to manage, prioritize, and troubleshoot on a ...