Reporting

Extract a value of the field as count

geeksk01
New Member

I have a log like this 

{"module": “x”, "app_name": “sample”-app, "message": "Number of  Transactions :52”}. I need to extract the value 52 as count.

I can use    eval c1=substr(message,25,2) . But how can I use as count variable. I want to use this count to compare with another count

Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

What's wrong with what you have?  You have the count in a field called 'c1' so you should be able to compare with another count using eval.

| eval match = if(c1 == count, "Yes", "No")
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...