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!

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

Splunk Decoded: Business Transactions vs Business IQ

It’s the morning of Black Friday, and your e-commerce site is handling 10x normal traffic. Orders are flowing, ...

Fastest way to demo Observability

I’ve been having a lot of fun learning about Kubernetes and Observability. I set myself an interesting ...