Splunk Search

How to remove everything after a specific character and any digit

shaileshransing
Engager

I want remove everything after "-" and any digit for example -1,-2,-3...-9,-0 

I'm using rex function but not getting desired output.

current dataDesired o/p
splunk.server-1.9.0.CLIEN-server-38444splunk.server
abcd-available.server-7.0.0.RETCAR-server-75344abcd-available.server
Labels (2)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Try something like this

| rex mode=sed field=current "s/\-\d.*//g"

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try something like this

| rex mode=sed field=current "s/\-\d.*//g"
0 Karma
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...