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
.conf21 Now Fully Virtual!
Register for FREE Today!

We've made .conf21 totally virtual and totally FREE! Our completely online experience will run from 10/19 through 10/20 with some additional events, too!