Splunk Search

how to remove the double quotes using regex

dtccsundar
Path Finder

Hi,

my regex was like below ,

search| rex field=_raw "Status=(?<Status>\"\w+\s+\w+\".*?)," |stats count by Status

My output is like below ,

Status                      count 

"No Service"           250

Service                      500

but i am in need of output as below ,

Status                      count 

No Service           250

Service                   500

I am in need of status ("No Service") as No Service with double quotes in Output .Please let me know what i am missing here .

Labels (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Perhaps a simple sed will do.

... | rex mode=sed field=Status "s/\\\"//g"
---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Perhaps a simple sed will do.

... | rex mode=sed field=Status "s/\\\"//g"
---
If this reply helps you, Karma would be appreciated.

dtccsundar
Path Finder

This works fine . Thank You 

0 Karma
Get Updates on the Splunk Community!

See just what you’ve been missing | Observability tracks at Splunk University

Looking to sharpen your observability skills so you can better understand how to collect and analyze data from ...

Weezer at .conf25? Say it ain’t so!

Hello Splunkers, The countdown to .conf25 is on-and we've just turned up the volume! We're thrilled to ...

How SC4S Makes Suricata Logs Ingestion Simple

Network security monitoring has become increasingly critical for organizations of all sizes. Splunk has ...