Splunk Search

How can I count which different lines

keyu921
Explorer

My Data as following
AA || Disabled || Region
11@abc.com || Yes || HK
12@abc.com || No || US
13@abc.com || No || US
14@abc.com || No || UK
15@abc.com || Yes || UK
16@abc.com || No || UK
17@abc.com || No || UK
18@abc.com || No || HK
19@abc.com || Yes || HK

I would like to count as following
% of account disable and enable in different region

| stats count(eval(status=="No")) as var1 by CountryRegion, count(eval(status=="Yes")) as var2 by CountryRegion ???

Labels (1)
Tags (1)
0 Karma
1 Solution

ragedsparrow
Contributor
<base search>
| stats count as Count by Region, Disabled
| eventstats sum(Count) as Total by Region
| eval "State Percentages"=round(Count*100/Total,2) | fields - Total

Would something like this work?

View solution in original post

0 Karma

ragedsparrow
Contributor
<base search>
| stats count as Count by Region, Disabled
| eventstats sum(Count) as Total by Region
| eval "State Percentages"=round(Count*100/Total,2) | fields - Total

Would something like this work?

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 ...