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!

AppDynamics Summer Webinars

This summer, our mighty AppDynamics team is cooking up some delicious content on YouTube Live to satiate your ...

SOCin’ it to you at Splunk University

Splunk University is expanding its instructor-led learning portfolio with dedicated Security tracks at .conf25 ...

Credit Card Data Protection & PCI Compliance with Splunk Edge Processor

Organizations handling credit card transactions know that PCI DSS compliance is both critical and complex. The ...