Dashboards & Visualizations

Need help with REX after a String

sen8sen
Engager

Hi Team,

 

 I am trying to extract the value after a particular string format and its not getting the right value.

The Value i wanted is after this string "COUNT(1)=*"

{ORD_CRTN_DTE=XXXXXXXX, COUNTRY=XXXXXX, AGENCY=XXXXXXX, PGM_CDE=XXXXXXX, COUNT(1)=1}]

I am using the the below rex and its not giving the value of the count i.e 1. The Rex I am using is below.

rex "COUNT(1)=(?<Count>\d+)"

Labels (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

You were *so* close.  Literal parentheses need to be escaped in regular expressions.  Otherwise, they're treated as a capture group.

| rex "COUNT\(1\)=(?<Count>\d+)"
---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

You were *so* close.  Literal parentheses need to be escaped in regular expressions.  Otherwise, they're treated as a capture group.

| rex "COUNT\(1\)=(?<Count>\d+)"
---
If this reply helps you, Karma would be appreciated.
0 Karma

sen8sen
Engager

Thanks a lot Rich 🙂

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 ...