Splunk Search

count problem

keyu921
Explorer

I have following data
email|country|license
aa|HK|365E1
bb|US|365E2
cc|HK|non-office
dd|HK|non-office
ee|UK|non-office

I would like to got bar chart that values of adopted (365E1+365E2) and non-adopted and count by country

base_search
| chart dc("email") AS Count over country by license

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

gcusello
SplunkTrust
SplunkTrust

Hi @keyu921,
you should find a way to identify adopted and non adopted and use this rule in an eval command, like the one:

base_search
| eval kind=if(license="non-office","non adopted","adopted")
| chart dc("email") OVER kind BY license

Ciao.
Giuseppe

View solution in original post

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @keyu921,
you should find a way to identify adopted and non adopted and use this rule in an eval command, like the one:

base_search
| eval kind=if(license="non-office","non adopted","adopted")
| chart dc("email") OVER kind BY license

Ciao.
Giuseppe

0 Karma

keyu921
Explorer

After I review the data, I got 30 license type, I want to keep 365E1 and 365E2 for adopted and others are non-adopted
How can I eval like?
| eval kind=if(license!="%OFFICE 365%","non adopted","adopted")
| chart dc("email") OVER kind BY country

0 Karma

keyu921
Explorer

thank you i got the diagram expected after modify some query

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