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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...