Splunk Cloud Platform

expression to capture all the delimiters and replace with space

Splunkerninja
Path Finder

Hi,

 

I have to replace all the possible delimiters in the field with space so that I capture each word separately.

Example: 5bb2a5-bb04-460e-a7bc-abb95d07a13_Setgfub.jpg I need to remove the extension as well it could be anything so .csv or .xslx or .do

I need the output as below
5bb2a8d5

bb04

460e

a7bc

bb995d07a13

Setgfub

 

I came up with expression which works fine but i need this either in regular expression or eval expression as I am using it for data model.

 

 

| makeresults 
| eval test="ton-o-mete_r v4.pdf" 
| rex field=test mode=sed "s/\-|\_|\.|\(|\)|\,|\;/ /g"
| eval temp=split('test'," "

 

 

 

Tags (3)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Try this rex command.  It extracts the individual fields directly.

| makeresults 
| eval test="ton-o-mete_r v4.pdf" 
| rex field=test max_match=0 "(?<temp>[^\-_\.\(\),;\s]+)"

 

---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Try this rex command.  It extracts the individual fields directly.

| makeresults 
| eval test="ton-o-mete_r v4.pdf" 
| rex field=test max_match=0 "(?<temp>[^\-_\.\(\),;\s]+)"

 

---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

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

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...