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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...