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!

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...