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!

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

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...