<?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 Re: How to Generate Bar Chart to Include Hosts with No Events? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-Generate-Bar-Chart-to-Include-Hosts-with-No-Events/m-p/58269#M14243</link>
    <description>&lt;P&gt;I made a slighgt change to the code you suggested Hiroshi, I added the following to the end of my search so that the proper count is reported. 'Injecting' the 'extra' host into the results made a server with no sessions show as having 1. But now the chart shows what is needed and wanted by the user. &lt;/P&gt;

&lt;P&gt;Thank you again for your suggestion. I appreciate your time and expertise.&lt;/P&gt;

&lt;P&gt;The following is what I added to the end of the search to realign to the true session count value while reporting all of the servers:&lt;/P&gt;

&lt;P&gt;| eval SessionCount=SessionCount-1&lt;/P&gt;</description>
    <pubDate>Thu, 12 Sep 2013 16:30:16 GMT</pubDate>
    <dc:creator>rgcurry</dc:creator>
    <dc:date>2013-09-12T16:30:16Z</dc:date>
    <item>
      <title>How to Generate Bar Chart to Include Hosts with No Events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-Generate-Bar-Chart-to-Include-Hosts-with-No-Events/m-p/58266#M14240</link>
      <description>&lt;P&gt;I have a dashboard panel that displays the number of user sessions on a web server in a column chart. The user wants to know if we can display each of the hosts dedicated to his application even if there are no sessions in selected timeframe. Anything in the Time Picker less than 4hrs will show only a subset of the servers as the others will not have any sessions to report (this is currently only in our TEST Environment, so low volume of sessions -- for now). Is there a way to get Splunk to report each of the hosts reporting a particular sourcetype without any events during a particular timeframe?&lt;/P&gt;

&lt;P&gt;My current search looks something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="{INDEX}" sourcetype="{SOURCETYPE}" ENV="$ENV$" (host="$host$" AND host="{HOST_FILTER}")| 
    dedup sessionID | 
    search NOT "*{SEARCH_FILTER}*"  | 
    stats count AS SessionCount by host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I know that by the nature of this search, there will be events ONLY for those hosts that have had sessions in operation during the specified timeframe.  Basically what I am looking to do is force each host to report even if the value is 0 (zero). Can I 'inject' that info into the final search results?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2013 19:55:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-Generate-Bar-Chart-to-Include-Hosts-with-No-Events/m-p/58266#M14240</guid>
      <dc:creator>rgcurry</dc:creator>
      <dc:date>2013-09-09T19:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to Generate Bar Chart to Include Hosts with No Events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-Generate-Bar-Chart-to-Include-Hosts-with-No-Events/m-p/58267#M14241</link>
      <description>&lt;P&gt;It's aggregating [SessionCount=0] is to add events in the Sub Search How is?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt; | append [| inputlookup LOOKUP.CSV | eval SessionCount=0 | table host,SessionCount ] | stats sum(SessionCount) as SessionCount by host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;LOOKUP.CSV&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host
hostA
hostB
hostC
etc...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sub Search is also good in the search for the period can be extracted host.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2013 05:10:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-Generate-Bar-Chart-to-Include-Hosts-with-No-Events/m-p/58267#M14241</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2013-09-10T05:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to Generate Bar Chart to Include Hosts with No Events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-Generate-Bar-Chart-to-Include-Hosts-with-No-Events/m-p/58268#M14242</link>
      <description>&lt;P&gt;I will give this a try, it looks like it will do the trick. After I posted this, I got to wondering if I could use the lookup table I already had to "force feed" the host into the results but I did not think of using append to pull in that data. Nicely done Hiroshi! I will post back on the results. Right now -- all servers have been having active sessions over a 15min (our lowest timeframe) period.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Sep 2013 21:41:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-Generate-Bar-Chart-to-Include-Hosts-with-No-Events/m-p/58268#M14242</guid>
      <dc:creator>rgcurry</dc:creator>
      <dc:date>2013-09-11T21:41:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to Generate Bar Chart to Include Hosts with No Events?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-Generate-Bar-Chart-to-Include-Hosts-with-No-Events/m-p/58269#M14243</link>
      <description>&lt;P&gt;I made a slighgt change to the code you suggested Hiroshi, I added the following to the end of my search so that the proper count is reported. 'Injecting' the 'extra' host into the results made a server with no sessions show as having 1. But now the chart shows what is needed and wanted by the user. &lt;/P&gt;

&lt;P&gt;Thank you again for your suggestion. I appreciate your time and expertise.&lt;/P&gt;

&lt;P&gt;The following is what I added to the end of the search to realign to the true session count value while reporting all of the servers:&lt;/P&gt;

&lt;P&gt;| eval SessionCount=SessionCount-1&lt;/P&gt;</description>
      <pubDate>Thu, 12 Sep 2013 16:30:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-Generate-Bar-Chart-to-Include-Hosts-with-No-Events/m-p/58269#M14243</guid>
      <dc:creator>rgcurry</dc:creator>
      <dc:date>2013-09-12T16:30:16Z</dc:date>
    </item>
  </channel>
</rss>

