Reporting

How to get count of hosts per type of event?

aykay403
Engager

Hi there, hoping this is a quick question:

I've got a search which polls for several eventlog types, and I want to put them into a table by event type using number of hosts in each event type, rather than just the total of events per type.

Right now it looks something like:

(searchForA=A) (searchForB=B) (searchForC=C) (searchForD=D) 

| eval EventType=case(

match(searchForA, "A"), "Results of A",

match(searchForB, "B"), "Results of B",

match(searchForC, "C"), "Results of C",

match(searchForD, "D"), "Results of D")

stats count by EventType

This shows me the counts of each event type no problem, and it works to show really big numbers, but what I'd like to show is a count of hosts per event type.... so like... | stats count by host PER EventType.

Any help would be great!

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

PickleRick
SplunkTrust
SplunkTrust

Do you mean

| stats dc(host) by EventType

or perhaps (showing the hosts, not counting)

| stats values(host) by EventType

 

Oh, and be careful with the vocabulary. In splunk's context, the "eventtype" word has some specific meaning so if you want to avoid misunderstandings, you can try to use another term.

View solution in original post

PickleRick
SplunkTrust
SplunkTrust

Do you mean

| stats dc(host) by EventType

or perhaps (showing the hosts, not counting)

| stats values(host) by EventType

 

Oh, and be careful with the vocabulary. In splunk's context, the "eventtype" word has some specific meaning so if you want to avoid misunderstandings, you can try to use another term.

aykay403
Engager

Pickle Riiiiick! Thanks!

0 Karma
Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...