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!

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...

Integrating Splunk Search API and Quarto to Create Reproducible Investigation ...

 Splunk is More Than Just the Web Console For Digital Forensics and Incident Response (DFIR) practitioners, ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...