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!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...