Splunk Search

How to remove part of a field value?

chadman
Path Finder

I have a search that gives me a bunch of fields that look like:
REBOOT=4/5/2016 9:17:19 AM
REBOOT=4/5/2016 9:12:02 AM
REBOOT=4/5/2016 8:58:28 AM

How can I remove the REBOOT= and keep the date/time with my search

0 Karma
1 Solution

somesoni2
Revered Legend

If the "REBOOT=4/5/2016 9:17:19 AM" appear as a value for a field, you can do like htis

your base search | replace "REBOOT=*" with * in yourfieldname(s)

If this appears in the raw data, try like this

your base search | rex mode=sed "s/REBOOT=//g"

View solution in original post

somesoni2
Revered Legend

If the "REBOOT=4/5/2016 9:17:19 AM" appear as a value for a field, you can do like htis

your base search | replace "REBOOT=*" with * in yourfieldname(s)

If this appears in the raw data, try like this

your base search | rex mode=sed "s/REBOOT=//g"

chadman
Path Finder

Thanks, that's what I was looking for.

Chad

0 Karma
Get Updates on the Splunk Community!

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...

Announcing the Migration of the Splunk Add-on for Microsoft Azure Inputs to ...

Announcing the Migration of the Splunk Add-on for Microsoft Azure Inputs to Officially Supported Splunk ...