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!

Updated Data Type Articles, Anniversary Celebrations, and More on Splunk Lantern

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

A Prelude to .conf25: Your Guide to Splunk University

Heading to Boston this September for .conf25? Get a jumpstart by arriving a few days early for Splunk ...

4 Ways the Splunk Community Helps You Prepare for .conf25

.conf25 is right around the corner, and whether you’re a first-time attendee or a seasoned Splunker, the ...