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!

What You Read The Most: Splunk Lantern’s Most Popular Articles!

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Announcing the General Availability of Splunk Enterprise Security 8.1!

We are pleased to announce the general availability of Splunk Enterprise Security 8.1. Splunk becomes the only ...

Developer Spotlight with William Searle

The Splunk Guy: A Developer’s Path from Web to Cloud William is a Splunk Professional Services Consultant with ...