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, an upvote 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, an upvote would be appreciated.

View solution in original post

0 Karma

sen8sen
Engager

Thanks a lot Rich 🙂

0 Karma
Register for .conf21 Now! Go Vegas or Go Virtual!

How will you .conf21? You decide! Go in-person in Las Vegas, 10/18-10/21, or go online with .conf21 Virtual, 10/19-10/20.