Splunk Search

How can I subtract three values from Json?

gcescatto
New Member

Hi!
I have a Json like this:
{"LicenseNum":62,
"Status":"Registered"}
and the Status can differ from three types: Registered, Disconnected and Dropped.
alt text

Based on this chart, I need to build a new one with the following mathematical equation: number of Registered - number of Disconnected - number of Dropped.
Could somebody please help me?
I've already tried to use the stats and eval function, but I probably did something really wrong.

Thank you in advance (:

Tags (3)
0 Karma
1 Solution

skoelpin
SplunkTrust
SplunkTrust

Try adding this

... | eval Remaining = Registered - Disconnected - Dropped

View solution in original post

0 Karma

skoelpin
SplunkTrust
SplunkTrust

Try adding this

... | eval Remaining = Registered - Disconnected - Dropped

0 Karma

gcescatto
New Member

I've already tried it. I'm using the following query:

eval License=(Registered - Disconnected - Dropped) | chart max(LicenseNum) by DateTime, License

But I keep getting as result just "Registered - Disconnected"

0 Karma
Get Updates on the Splunk Community!

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...