<?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 create a chart to show count of events by hour over days in a week? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-chart-to-show-count-of-events-by-hour-over-days/m-p/406503#M41356</link>
    <description>&lt;P&gt;Hi, Have you tried swapping hour day as mentioned by @DalJeanis?&lt;BR /&gt;
you have | chart sum(hourcount) as count by day hour&lt;BR /&gt;
 instead of &lt;BR /&gt;
| chart sum(hourcount) as count by hour day&lt;/P&gt;</description>
    <pubDate>Thu, 28 Jun 2018 10:25:20 GMT</pubDate>
    <dc:creator>Sukisen1981</dc:creator>
    <dc:date>2018-06-28T10:25:20Z</dc:date>
    <item>
      <title>How to create a chart to show count of events by hour over days in a week?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-chart-to-show-count-of-events-by-hour-over-days/m-p/406499#M41352</link>
      <description>&lt;P&gt;Below is the search query i used in order to get a similar chart but the hours are not consecutive, as shown in the Legend's table on the right side. What i have in mind was to create a chart that displays the count of high severity events by hour in a day for a week and have the chart start on a Monday and ends on a Sunday instead of starting on the current day&lt;/P&gt;

&lt;P&gt;I have went and search for various and multiple sources on how to solve this problem and tried using %w, earliest=+7d@w1, | bin span=1d, and so on in my queries in trying to create the desired chart&lt;/P&gt;

&lt;P&gt;Thanks and looking forward to replies&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5278i66591C9C5F9DA29C/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 02:36:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-chart-to-show-count-of-events-by-hour-over-days/m-p/406499#M41352</guid>
      <dc:creator>CWH617</dc:creator>
      <dc:date>2018-06-28T02:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a chart to show count of events by hour over days in a week?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-chart-to-show-count-of-events-by-hour-over-days/m-p/406500#M41353</link>
      <description>&lt;P&gt;First, you want the count by hour, so you need to bin by hour.  Second, once you've added up the bins, you need to present teh output in terms of day and hour.&lt;/P&gt;

&lt;P&gt;Here's one version.  You can swap the order of &lt;CODE&gt;hour&lt;/CODE&gt; and &lt;CODE&gt;day&lt;/CODE&gt; in the &lt;CODE&gt;chart&lt;/CODE&gt; command if you prefer to swap the column and row headers.  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your search that gets the events you want
| bin _time as hour span=1h
| stats count as hourcount by hour
| bin hour as day span=1d
| eval day=strftime(day,"%Y-%m-%d")
| eval hour=strftime(hour,"%H:%M")
| chart sum(hourcount) as count by hour day
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Jun 2018 02:48:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-chart-to-show-count-of-events-by-hour-over-days/m-p/406500#M41353</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-06-28T02:48:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a chart to show count of events by hour over days in a week?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-chart-to-show-count-of-events-by-hour-over-days/m-p/406501#M41354</link>
      <description>&lt;P&gt;Hi thanks for your fast reply. I have tried the search query you provided but the problem still lies on the chart not being able to produce events for every single hour from 00:00 to 23:00 and also not in a full week i.e from Monday to Sunday. &lt;/P&gt;

&lt;P&gt;The last picture are a separate "hours in a day" and "days in a week" chart. Initially this was the desired output i wanted to have, but the resulting search query im trying to do is a combination of both these charts into one where one day has all individual hours shown in the chart together with the rest of the days and display altogether as a single graph&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5275i7C23F56A37F5222C/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5276i1EA2B73F5B2F85C8/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 03:26:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-chart-to-show-count-of-events-by-hour-over-days/m-p/406501#M41354</guid>
      <dc:creator>CWH617</dc:creator>
      <dc:date>2018-06-28T03:26:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a chart to show count of events by hour over days in a week?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-chart-to-show-count-of-events-by-hour-over-days/m-p/406502#M41355</link>
      <description>&lt;P&gt;Hi DalJeanis, i was unable to attach photos in the comments sections so i have posted my reply as an answer. Please do take a look at it. Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 03:28:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-chart-to-show-count-of-events-by-hour-over-days/m-p/406502#M41355</guid>
      <dc:creator>CWH617</dc:creator>
      <dc:date>2018-06-28T03:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a chart to show count of events by hour over days in a week?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-chart-to-show-count-of-events-by-hour-over-days/m-p/406503#M41356</link>
      <description>&lt;P&gt;Hi, Have you tried swapping hour day as mentioned by @DalJeanis?&lt;BR /&gt;
you have | chart sum(hourcount) as count by day hour&lt;BR /&gt;
 instead of &lt;BR /&gt;
| chart sum(hourcount) as count by hour day&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 10:25:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-chart-to-show-count-of-events-by-hour-over-days/m-p/406503#M41356</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2018-06-28T10:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a chart to show count of events by hour over days in a week?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-chart-to-show-count-of-events-by-hour-over-days/m-p/406504#M41357</link>
      <description>&lt;P&gt;Hi @Sukisen1981. Yes i did. count by hour day was the initial query @DalJeanis provided&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 11:25:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-chart-to-show-count-of-events-by-hour-over-days/m-p/406504#M41357</guid>
      <dc:creator>CWH617</dc:creator>
      <dc:date>2018-06-28T11:25:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a chart to show count of events by hour over days in a week?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-chart-to-show-count-of-events-by-hour-over-days/m-p/406505#M41358</link>
      <description>&lt;P&gt;strange indeed, either we are not understanding your use case or there is something weird going on. Try this query , run it as it is since the audit index is a default one&lt;BR /&gt;
    index="_audit"  | bin _time as hour span=1h&lt;BR /&gt;
     | stats count as hourcount by hour&lt;BR /&gt;
     | bin hour as day span=1d&lt;BR /&gt;
     | eval day=strftime(day,"%Y-%m-%d")&lt;BR /&gt;
     | eval hour=strftime(hour,"%H:%M")&lt;BR /&gt;
     | chart sum(hourcount) as count by hour,day&lt;/P&gt;

&lt;P&gt;Now, I ran this over a week, month to date and I do receive the hours on xaxis, days on the yaxis...Are you not receiving the same output?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 11:38:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-chart-to-show-count-of-events-by-hour-over-days/m-p/406505#M41358</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2018-06-28T11:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a chart to show count of events by hour over days in a week?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-chart-to-show-count-of-events-by-hour-over-days/m-p/406506#M41359</link>
      <description>&lt;P&gt;@Sukisen1981, i got similar results where days are on the y-axis and hours on the x-axis, but what i was trying to do is to sort of have like a dual x-axis, where the events would show at a one hour interval, and it would show at a span of 1 week&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jun 2018 12:20:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-chart-to-show-count-of-events-by-hour-over-days/m-p/406506#M41359</guid>
      <dc:creator>CWH617</dc:creator>
      <dc:date>2018-06-28T12:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a chart to show count of events by hour over days in a week?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-chart-to-show-count-of-events-by-hour-over-days/m-p/406507#M41360</link>
      <description>&lt;P&gt;Hi @Sukisen, i have gotten the same output but its not what i was looking for. Below shows the chart i wanted to achieve, with the time from 00:00 to 23:00 in one day concurrently, and then to display it at the span of a week&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5277iE05391FF42DCCAB4/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2018 02:40:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-chart-to-show-count-of-events-by-hour-over-days/m-p/406507#M41360</guid>
      <dc:creator>CWH617</dc:creator>
      <dc:date>2018-06-29T02:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a chart to show count of events by hour over days in a week?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-chart-to-show-count-of-events-by-hour-over-days/m-p/406508#M41361</link>
      <description>&lt;P&gt;When you do a &lt;CODE&gt;timechart&lt;/CODE&gt; it sorts the stack alphabetically; see this run-anywhere example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal 
|  timechart count BY sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But you can add an extra line to resort, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal 
|  timechart count BY sourcetype
| table _time splunk* mongo* *
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 30 Jun 2018 23:54:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-chart-to-show-count-of-events-by-hour-over-days/m-p/406508#M41361</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-06-30T23:54:08Z</dc:date>
    </item>
  </channel>
</rss>

