<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to list all hosts with their fields? in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-list-all-hosts-with-their-fields/m-p/606466#M13394</link>
    <description>&lt;P&gt;Hi everyone, I want to create an hourly alert that logs the multiple server's CPU usage, queue length, memory usage and disk space used.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have managed to create the following query which helps me lists out my requirements nicely in the following image. (Note that in the image, the log is set to output every 5 minutes only, hence the null values in the image below)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=* host=abc_server tag=performance (cpu_load_percent=* OR wait_threads_count=* OR mem_free_percent=* OR storage_free_percent=*)  
| eval cpu_load = 100 -  PercentIdleTime 
| eval mem_used_percent = 100 - mem_free_percent
| eval storage_used_percent = 100 - storage_free_percent 
| timechart eval(round(avg(cpu_load),2)) as "CPU Usage (%)", 
            eval(round(avg(wait_threads_count), 2)) as "Queue Length", 
            eval(round(avg(mem_used_percent), 2)) as "Memory Used (%)", 
            eval(round(avg(storage_used_percent), 2)) as "Disk Space Used (%)"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="snapshot.PNG" style="width: 930px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/20621iBCC70AAA1393250E/image-size/large?v=v2&amp;amp;px=999" role="button" title="snapshot.PNG" alt="snapshot.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;For the next step however, I am unable to insert the host's name as another column. Is there a way where I can insert a new column for Host Name in a timechart as shown below?&lt;/P&gt;
&lt;TABLE border="1" width="100.00000000000001%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;Host name&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;_time&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;CPU Usage&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;Queue Length&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;Memory Usage&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;Disk Space Usage&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;abc_server&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;&lt;SPAN&gt;2022-07-21 10:00:00&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;1.00&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;0.00&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;37.30&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;9.12&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;efg_server&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;&lt;SPAN&gt;2022-07-21 10:00:00&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;0.33&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;0.00&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;26.50&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;8.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;your_server&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;&lt;SPAN&gt;2022-07-21 10:00:00&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;9.21&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;0.00&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;10.30&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;5.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;abc_server&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;&lt;SPAN&gt;2022-07-21 10:01:00&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;1.32&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;0.00&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;37.30&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;9.12&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;efg_server&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;&lt;SPAN&gt;2022-07-21 10:01:00&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;0.89&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;0.00&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;26.50&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;8.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;your_server&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;&lt;SPAN&gt;2022-07-21 10:01:00&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;8.90&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;0.00&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;10.30&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;5.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 22 Jul 2022 00:39:54 GMT</pubDate>
    <dc:creator>Michael_Scott</dc:creator>
    <dc:date>2022-07-22T00:39:54Z</dc:date>
    <item>
      <title>How to list all hosts with their fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-list-all-hosts-with-their-fields/m-p/606466#M13394</link>
      <description>&lt;P&gt;Hi everyone, I want to create an hourly alert that logs the multiple server's CPU usage, queue length, memory usage and disk space used.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have managed to create the following query which helps me lists out my requirements nicely in the following image. (Note that in the image, the log is set to output every 5 minutes only, hence the null values in the image below)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=* host=abc_server tag=performance (cpu_load_percent=* OR wait_threads_count=* OR mem_free_percent=* OR storage_free_percent=*)  
| eval cpu_load = 100 -  PercentIdleTime 
| eval mem_used_percent = 100 - mem_free_percent
| eval storage_used_percent = 100 - storage_free_percent 
| timechart eval(round(avg(cpu_load),2)) as "CPU Usage (%)", 
            eval(round(avg(wait_threads_count), 2)) as "Queue Length", 
            eval(round(avg(mem_used_percent), 2)) as "Memory Used (%)", 
            eval(round(avg(storage_used_percent), 2)) as "Disk Space Used (%)"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="snapshot.PNG" style="width: 930px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/20621iBCC70AAA1393250E/image-size/large?v=v2&amp;amp;px=999" role="button" title="snapshot.PNG" alt="snapshot.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;For the next step however, I am unable to insert the host's name as another column. Is there a way where I can insert a new column for Host Name in a timechart as shown below?&lt;/P&gt;
&lt;TABLE border="1" width="100.00000000000001%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;Host name&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;_time&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;CPU Usage&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;Queue Length&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;Memory Usage&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;Disk Space Usage&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;abc_server&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;&lt;SPAN&gt;2022-07-21 10:00:00&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;1.00&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;0.00&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;37.30&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;9.12&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;efg_server&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;&lt;SPAN&gt;2022-07-21 10:00:00&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;0.33&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;0.00&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;26.50&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;8.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;your_server&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;&lt;SPAN&gt;2022-07-21 10:00:00&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;9.21&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;0.00&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;10.30&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;5.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;abc_server&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;&lt;SPAN&gt;2022-07-21 10:01:00&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;1.32&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;0.00&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;37.30&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;9.12&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;efg_server&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;&lt;SPAN&gt;2022-07-21 10:01:00&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;0.89&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;0.00&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;26.50&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;8.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;your_server&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;&lt;SPAN&gt;2022-07-21 10:01:00&lt;/SPAN&gt;&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;8.90&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;0.00&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;10.30&lt;/TD&gt;
&lt;TD width="16.666666666666668%" height="47px"&gt;5.00&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 00:39:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-list-all-hosts-with-their-fields/m-p/606466#M13394</guid>
      <dc:creator>Michael_Scott</dc:creator>
      <dc:date>2022-07-22T00:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to list all hosts with their fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-list-all-hosts-with-their-fields/m-p/606490#M13400</link>
      <description>&lt;P&gt;Yes, you are able to.&amp;nbsp; It's just a matter of adding a &lt;FONT face="courier new,courier"&gt;by&lt;/FONT&gt; clause to the &lt;FONT face="courier new,courier"&gt;timestamp&lt;/FONT&gt; command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=* host=abc_server tag=performance (cpu_load_percent=* OR wait_threads_count=* OR mem_free_percent=* OR storage_free_percent=*)  
| eval cpu_load = 100 -  PercentIdleTime 
| eval mem_used_percent = 100 - mem_free_percent
| eval storage_used_percent = 100 - storage_free_percent 
| timechart eval(round(avg(cpu_load),2)) as "CPU Usage (%)", 
            eval(round(avg(wait_threads_count), 2)) as "Queue Length", 
            eval(round(avg(mem_used_percent), 2)) as "Memory Used (%)", 
            eval(round(avg(storage_used_percent), 2)) as "Disk Space Used (%)"
    by host&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 11:54:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-list-all-hosts-with-their-fields/m-p/606490#M13400</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-07-22T11:54:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to List all hosts with their fields</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-list-all-hosts-with-their-fields/m-p/606568#M13403</link>
      <description>&lt;P&gt;To get host as a column (basically one row for each for every time bucket ), you'd have to use this alternative to timechart.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=* host=abc_server tag=performance (cpu_load_percent=* OR wait_threads_count=* OR mem_free_percent=* OR storage_free_percent=*)  
| eval cpu_load = 100 -  PercentIdleTime 
| eval mem_used_percent = 100 - mem_free_percent
| eval storage_used_percent = 100 - storage_free_percent 
| bucket _time
| stats eval(round(avg(cpu_load),2)) as "CPU Usage (%)", 
            eval(round(avg(wait_threads_count), 2)) as "Queue Length", 
            eval(round(avg(mem_used_percent), 2)) as "Memory Used (%)", 
            eval(round(avg(storage_used_percent), 2)) as "Disk Space Used (%)" by _time host&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 21 Jul 2022 20:39:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-list-all-hosts-with-their-fields/m-p/606568#M13403</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2022-07-21T20:39:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to List all hosts with their fields</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-list-all-hosts-with-their-fields/m-p/606612#M13415</link>
      <description>&lt;P&gt;apparently the stats command does not understand the eval() argument. It treats it as an invalid argument&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jul 2022 07:45:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-list-all-hosts-with-their-fields/m-p/606612#M13415</guid>
      <dc:creator>Michael_Scott</dc:creator>
      <dc:date>2022-07-22T07:45:41Z</dc:date>
    </item>
  </channel>
</rss>

