Splunk Search

regex - remove comma from the result

krusovice
Path Finder

Hello all,

I have a problem extracting field using regex. The nearest query I've made is:

index=* | rex field=_raw "/application/(?<type>[\S+]+)" | stats count by type

However, the result extracted comes with a comma at the end. Example of result is

toy1,
/store/toy2,
/store/US/toy4,

What should I do to remove the comma ( , ) from the result?

Thanks.

Tags (1)
0 Karma
1 Solution

493669
Super Champion

try this rex:

 index=* |rex "/application/(?<type>[^,]+)"

View solution in original post

0 Karma

493669
Super Champion

try this rex:

 index=* |rex "/application/(?<type>[^,]+)"
0 Karma

krusovice
Path Finder

Thank you, it works!

0 Karma
Get Updates on the Splunk Community!

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...