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!

Splunk Forwarders and Forced Time Based Load Balancing

Splunk customers use universal forwarders to collect and send data to Splunk. A universal forwarder can send ...

NEW! Log Views in Splunk Observability Dashboards Gives Context From a Single Page

Today, Splunk Observability releases log views, a new feature for users to add their logs data from Splunk Log ...

Last Chance to Submit Your Paper For BSides Splunk - Deadline is August 12th!

Hello everyone! Don't wait to submit - The deadline is August 12th! We have truly missed the community so ...