Splunk Search

remove characters in field results

numeroinconnu12
Path Finder

Morning, everyone,

Thank you in advance for your help.

I would like to remove a part of a character from my results.

My query results look like this:

TRERY\j2874ac
TRERY\k5846de

I'd like to delete the "TRERY\" to get it:

j2874ac
k5846de

How do I proceed? Thank you very much.

Labels (1)
0 Karma
1 Solution

bowesmana
SplunkTrust
SplunkTrust

The rex statement below will work

| makeresults
| eval result=split("TRERY\j2874ac,TRERY\k5846de",",")
| mvexpand result
| rex field=result mode=sed "s/^TRERY\\\//"

You can run the above example

View solution in original post

bowesmana
SplunkTrust
SplunkTrust

The rex statement below will work

| makeresults
| eval result=split("TRERY\j2874ac,TRERY\k5846de",",")
| mvexpand result
| rex field=result mode=sed "s/^TRERY\\\//"

You can run the above example

numeroinconnu12
Path Finder

Thank you @bowesmana  it works. 

0 Karma
Get Updates on the Splunk Community!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

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

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...