Splunk Search

Why is my regex for SEDCMD in props.conf not removing repeated dashes when parsing data?

daniel333
Builder

My developers are adding dashes --- in their logs all over. Sometimes 1.. sometimes 10 dashes. Makes them look really ugly in Splunk. Hoping to remove them using SEDCMD. Any idea why this isn't working?

SEDCMD-fixdash=s/[-]*/-/g

thanks,
-Daniel

0 Karma

s2_splunk
Splunk Employee
Splunk Employee

If they are your developers, make them stop doing that stuff and log JSON instead. 😉

s2_splunk
Splunk Employee
Splunk Employee

Try SEDCMD-fixdash=s/-+/-/g
Dash is not a RegEx special character, so no character class needed. '+' means 'one or more'.

Get Updates on the Splunk Community!

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...