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!

How I Instrumented a Rust Application Without Knowing Rust

As a technical writer, I often have to edit or create code snippets for Splunk's distributions of ...

Splunk Community Platform Survey

Hey Splunk Community, Starting today, the community platform may prompt you to participate in a survey. The ...

Observability Highlights | November 2022 Newsletter

 November 2022Observability CloudEnd Of Support Extension for SignalFx Smart AgentSplunk is extending the End ...