Dashboards & Visualizations

How to handle HEX within fields

splunker1981
Path Finder

Hi everyone,

Trying to figure out the best way to tackle two issues - both of which are related to one logsource.

I have mail logs which logs attachment names like what is shown below.
"This=20is=20a=test.pdf"

What is the best way to handle this? Is there a way to take care of this when ingesting the log data or is the better approach to do this at search time? I wan to be able to run a search for attachment_name="This is a test.pdf" which I can't see to do right now without ensuring that I include the HEX values for certain characters.

My other question also related to the same log source. Following the recommend settings for cim compliance the name and the extension get logged in two separate fields. What's the best way to handle this during searches so I can, again, search for the exact filename including extension?

Right now what I've been doing is something like:
searchHere (attachment_name="This=20is=20a=test" AND filetype="pdf")

What I'd like to be able to do is:
searchHere attachment="This is a test.pdf"

What is the recommended solution for this? Should an additional field be created which combines both values or is there a good way to do this at searchtime?

Thanks for all the help!

Tags (1)
0 Karma
1 Solution

jbjerke_splunk
Splunk Employee
Splunk Employee

Hi splunker1981

You can join two fields with the eval command. You can do this directly in the search bar or add it to the automatically calculated fields. under Settings->Fields

The command would look like:
YOURSEARCH | eval attachment=filename.filetype

For the HEX conversion, there is an app in the app store that adds some additional functions to the Splunk search language.

DECRYPT
https://splunkbase.splunk.com/app/2655/

With this app you should be able to decode this at search time with a search command like this:

| decrypt f=attachement_name unhex

Let me know how you get along.

j

View solution in original post

jbjerke_splunk
Splunk Employee
Splunk Employee

Hi splunker1981

You can join two fields with the eval command. You can do this directly in the search bar or add it to the automatically calculated fields. under Settings->Fields

The command would look like:
YOURSEARCH | eval attachment=filename.filetype

For the HEX conversion, there is an app in the app store that adds some additional functions to the Splunk search language.

DECRYPT
https://splunkbase.splunk.com/app/2655/

With this app you should be able to decode this at search time with a search command like this:

| decrypt f=attachement_name unhex

Let me know how you get along.

j

splunker1981
Path Finder

Thanks that was just what I was looking for.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...