<?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 Can you help me chart a statistics table on a month by month basis? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-chart-a-statistics-table-on-a-month-by-month/m-p/396595#M172078</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have a search that generates a statistics table based on the timerange I select.&lt;/P&gt;

&lt;P&gt;How can I select, lets say, a timerange of 1 year and have the statistics generated and displayed over each month? I want to avoid manually having to change the time range to select each month, view statistics, etc...&lt;/P&gt;

&lt;P&gt;This is my search &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=autosys source=
| where status="SUCCESS"
| eval startTimeEpoch = strptime(startTime, "%Y-%m-%d %H:%M:%S")
| eval startTimeHour = strftime(startTimeEpoch, "%H") 
| eval endTimeEpoch = strptime(endTime, "%Y-%m-%d %H:%M:%S")
| eval endTimeHour = strftime(endTimeEpoch, "%H") 
| eventstats count(startTimeHour) AS startHourCount by startTimeHour
| eventstats count(endTimeHour) As endHourCount by endTimeHour
| eventstats count(jobName) As RunCount by jobName
| eval startHourPercent = ((startHourCount / RunCount) * 100)
| eval endHourPercent = ((endHourCount / RunCount) * 100)
| eval roundedStartHourPercent =round(startHourPercent)
| eval roundedEndHourPercent =round(endHourPercent)
| dedup startTimeHour endTimeHour
| sort -roundedStartHourPercent
| sort -roundedEndHourPercent
| table jobName startTimeHour endTimeHour 
&lt;/CODE&gt;&lt;/PRE&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/6836i9A8728A499E66C59/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>Tue, 02 Apr 2019 14:49:58 GMT</pubDate>
    <dc:creator>x213217</dc:creator>
    <dc:date>2019-04-02T14:49:58Z</dc:date>
    <item>
      <title>Can you help me chart a statistics table on a month by month basis?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-chart-a-statistics-table-on-a-month-by-month/m-p/396595#M172078</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I have a search that generates a statistics table based on the timerange I select.&lt;/P&gt;

&lt;P&gt;How can I select, lets say, a timerange of 1 year and have the statistics generated and displayed over each month? I want to avoid manually having to change the time range to select each month, view statistics, etc...&lt;/P&gt;

&lt;P&gt;This is my search &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=autosys source=
| where status="SUCCESS"
| eval startTimeEpoch = strptime(startTime, "%Y-%m-%d %H:%M:%S")
| eval startTimeHour = strftime(startTimeEpoch, "%H") 
| eval endTimeEpoch = strptime(endTime, "%Y-%m-%d %H:%M:%S")
| eval endTimeHour = strftime(endTimeEpoch, "%H") 
| eventstats count(startTimeHour) AS startHourCount by startTimeHour
| eventstats count(endTimeHour) As endHourCount by endTimeHour
| eventstats count(jobName) As RunCount by jobName
| eval startHourPercent = ((startHourCount / RunCount) * 100)
| eval endHourPercent = ((endHourCount / RunCount) * 100)
| eval roundedStartHourPercent =round(startHourPercent)
| eval roundedEndHourPercent =round(endHourPercent)
| dedup startTimeHour endTimeHour
| sort -roundedStartHourPercent
| sort -roundedEndHourPercent
| table jobName startTimeHour endTimeHour 
&lt;/CODE&gt;&lt;/PRE&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/6836i9A8728A499E66C59/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>Tue, 02 Apr 2019 14:49:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-chart-a-statistics-table-on-a-month-by-month/m-p/396595#M172078</guid>
      <dc:creator>x213217</dc:creator>
      <dc:date>2019-04-02T14:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me chart a statistics table on a month by month basis?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-chart-a-statistics-table-on-a-month-by-month/m-p/396596#M172079</link>
      <description>&lt;P&gt;YOu don't show any of the calculated fields in the final output, do you really need to do those calculations? What type of reporting you're trying to do?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 16:22:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-chart-a-statistics-table-on-a-month-by-month/m-p/396596#M172079</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-04-02T16:22:27Z</dc:date>
    </item>
  </channel>
</rss>

