Splunk Search

difference of two counts

lain179
Communicator

chart count(IN), count(OUT), count(EXP) by SERVER

I also want to include the calculated value of count(IN)-count(OUT)-count(EXP) on the column chart. How can I include that calculation?

Thanks!

Tags (1)
0 Karma
1 Solution

sdaniels
Splunk Employee
Splunk Employee

I can't try it right now but it probably looks like this:

<search> | stats count(IN) as inCount, count(OUT) as outCount, count(EXP) as expCount by SERVER | eval calcField = inCount - outCount - expCount | chart inCount, outCount, expCount, calcField by SERVER

View solution in original post

sdaniels
Splunk Employee
Splunk Employee

I can't try it right now but it probably looks like this:

<search> | stats count(IN) as inCount, count(OUT) as outCount, count(EXP) as expCount by SERVER | eval calcField = inCount - outCount - expCount | chart inCount, outCount, expCount, calcField by SERVER

lain179
Communicator

Thanks. That way works!

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...