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
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!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...