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+)"

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!

Say goodbye to manually analyzing phishing and malware threats with Splunk Attack ...

In today’s evolving threat landscape, we understand you’re constantly bombarded with phishing and malware ...

AppDynamics is now part of Splunk Ideas

Hello Splunkers, We have exciting news for you! AppDynamics has been added to the Splunk Ideas Portal. Which ...

Advanced Splunk Data Management Strategies

Join us on Wednesday, May 14, 2025, at 11 AM PDT / 2 PM EDT for an exclusive Tech Talk that delves into ...