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!

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...

Data Management Digest – November 2025

  Welcome to the inaugural edition of Data Management Digest! As your trusted partner in data innovation, the ...