Reporting

Get list of hosts and total number of hosts in 1 report

utk123
Path Finder

I have 2 reports which I want to combine so that I get 1 email with both information. 

1. Total number of hosts

index=abcd mysearch | stats count as Hostname

2. List of hosts

index=abcd mysearch | table Hostname

Results I expect:

Total Hostname: 145

Hostname

host1

host2

host3

 

Please advise.

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

isoutamo
SplunkTrust
SplunkTrust

Can you convert this to dashboard and schedule it? Probably this is the way to get exactly that expected result. Other option is get it little bit different format by next query:

index=abcde 
| stats dc(Hostname) as totalHostnames values(Hostname) as Hostnames

r. Ismo 

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| stats dc(hostname) as count by hostname
| addcoltotals

utk123
Path Finder

This also works, but accepted another answer as that is better in format. 

0 Karma

isoutamo
SplunkTrust
SplunkTrust

Can you convert this to dashboard and schedule it? Probably this is the way to get exactly that expected result. Other option is get it little bit different format by next query:

index=abcde 
| stats dc(Hostname) as totalHostnames values(Hostname) as Hostnames

r. Ismo 

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...