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
SplunkTrust
SplunkTrust
<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
SplunkTrust
SplunkTrust
<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!

Improve Your Security Posture

Watch NowImprove Your Security PostureCustomers are at the center of everything we do at Splunk and security ...

Maximize the Value from Microsoft Defender with Splunk

 Watch NowJoin Splunk and Sens Consulting for this Security Edition Tech TalkWho should attend:  Security ...

This Week's Community Digest - Splunk Community Happenings [6.27.22]

Get the latest news and updates from the Splunk Community here! News From Splunk Answers ✍️ Splunk Answers is ...