- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
nisha_kapoor
Path Finder
08-10-2017
12:00 PM
index=test TransactionId="xxx-xxx-xxx"| replace "000" with "" in Status| fields Status
I want to replace the first occurrence of "000" in status to blank.This is the command I wrote after referring to Splunk Documentation. However, the results don't show me the modified value of Status. Is there something missing in the command?
My end result should be the value of Status with "000" replaced.
Thanks for your help
1 Solution
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
sbbadri
Motivator
08-10-2017
01:28 PM
try this
index=test | eval TransactionId="xxx-xxx-xxx" | replace *000* with ** in Status
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
sbbadri
Motivator
08-10-2017
01:28 PM
try this
index=test | eval TransactionId="xxx-xxx-xxx" | replace *000* with ** in Status
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

somesoni2
Revered Legend
08-10-2017
12:24 PM
Try like this
index=test TransactionId="xxx-xxx-xxx"| eval Status=replace(Status,"^000(.+)","\1") | fields Status
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

cmerriman
Super Champion
08-10-2017
12:06 PM
try a regex command:
|rex field=Status mode=sed "s/000//g"
