Splunk Search

Sort hosts by number of services hit per host

JyotiP
Path Finder

For the query :
host=aeperf01api02 Level="INFO" | stats count by AppDomain
I have following output

Web                         4504
WebApi                    180240
ComplianceWeb              9384
ReportingWeb                34152
ReferenceDataWeb            161710
SecurityMasterWeb          78878
Login                      38514

I have 6 host like above, how to sort them in one query where I can present these output in rows and hosts in the column so that I can check what is the number of services hit by the particular host.

0 Karma
1 Solution

niketn
Legend

@JyotiP, instead of stats try the following chart command. The over host argument will put the host names in column and count by AppDomain.

<YourBaseSearchWithIndexAndSourceType> host=aeperf* Level="INFO" 
| chart count over host by AppDomain

PS: As best practice make sure you include index and sourcetype in your Base search which is missing in your Splunk Search example.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

0 Karma

niketn
Legend

@JyotiP, instead of stats try the following chart command. The over host argument will put the host names in column and count by AppDomain.

<YourBaseSearchWithIndexAndSourceType> host=aeperf* Level="INFO" 
| chart count over host by AppDomain

PS: As best practice make sure you include index and sourcetype in your Base search which is missing in your Splunk Search example.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

HiroshiSatoh
Champion

I want an image of the output.
For example, is this something like that?

host IN(aeperf01api02,AAA,BBB,CCC,DDD,EEE) Level="INFO" 
| stats count by host,AppDomain
0 Karma
Get Updates on the Splunk Community!

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

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

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