Splunk Cloud Platform

How to remove special characters from field values

iamsplunker
Communicator

Hi Splunkers, 

 

1) I wanted to remove all special characters from my field called "Test" other than "."(dot) and "-"(dash)
2) return the values in lower case.

example field values for Test
i4455.mango.com
qa (qa_a_ai_bi1_integration_d01)
app-9999-bee-mysql-prod

 

please help

Labels (1)
Tags (2)
0 Karma

PickleRick
SplunkTrust
SplunkTrust

There might be a better idea, but for example - like this (run-anywhere example).

| makeresults 
| eval test="qa (qa_a_ai_bi1_integra.tio-n_d01)"
| table test
| rex mode=sed field=test "s/[^-A-Za-z0-9.]//g"

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try something like this

 

| rex mode=sed field=Test "s/[^0-9a-zA-Z\.\-]//g"
| eval Test=lower(Test)

 

0 Karma
Get Updates on the Splunk Community!

Now Playing: Splunk Education Summer Learning Premieres

It’s premiere season, and Splunk Education is rolling out new releases you won’t want to miss. Whether you’re ...

The Visibility Gap: Hybrid Networks and IT Services

The most forward thinking enterprises among us see their network as much more than infrastructure – it's their ...

Get Operational Insights Quickly with Natural Language on the Splunk Platform

In today’s fast-paced digital world, turning data into actionable insights is essential for success. With ...