<?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: Need help on finding daily hourly max for a month for a timechart in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Need-help-on-finding-daily-hourly-max-for-a-month-for-a/m-p/345287#M102327</link>
    <description>&lt;P&gt;Wonderful explanation.&lt;/P&gt;</description>
    <pubDate>Tue, 25 Apr 2017 21:02:55 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2017-04-25T21:02:55Z</dc:date>
    <item>
      <title>Need help on finding daily hourly max for a month for a timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-on-finding-daily-hourly-max-for-a-month-for-a/m-p/345284#M102324</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I am pretty new to splunk and trying to figure out a splunk search query. I am extracting a monthly report of hourly volume of some services.&lt;/P&gt;

&lt;P&gt;I used following query:&lt;BR /&gt;
index=myIndex sourcetype=mysrctype |  timechart span=1h count by myapps&lt;/P&gt;

&lt;P&gt;This gives me result in following format:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;_time app1 app2   app3 app4&lt;/STRONG&gt;&lt;BR /&gt;
Date1Hr1    72  774 0   0&lt;BR /&gt;
Date1Hr2    34 234 0    0&lt;BR /&gt;
Date1Hr3    72  560 0&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
Date1Hr24 72    560 0 89&lt;BR /&gt;
Date2Hr1 72 560 0 87&lt;BR /&gt;
Date2Hr2 72 560 0 876&lt;BR /&gt;
Date2Hr3 72 560 0 87&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
Date31Hr24 72   560 0 76&lt;/P&gt;

&lt;P&gt;Question 1: How can I get Daily Max for all the applications for all 30 days?&lt;BR /&gt;
I tried &lt;BR /&gt;
index=myIndex sourcetype=mysrctype |  timechart span=1h count by myapps | stats max(*) as *&lt;BR /&gt;
But this gives me Max of all daily values for all 30 days. I am not able to get a "Daily" max using timechart.&lt;/P&gt;

&lt;P&gt;Question2: How can I add a linebreak after each day in timechart?&lt;/P&gt;

&lt;P&gt;Appreciate your help!!&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Payal&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2017 23:33:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-on-finding-daily-hourly-max-for-a-month-for-a/m-p/345284#M102324</guid>
      <dc:creator>payalgarg27</dc:creator>
      <dc:date>2017-04-24T23:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on finding daily hourly max for a month for a timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-on-finding-daily-hourly-max-for-a-month-for-a/m-p/345285#M102325</link>
      <description>&lt;P&gt;index=myIndex sourcetype=mysrctype | timechart max(Time)&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 17:23:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-on-finding-daily-hourly-max-for-a-month-for-a/m-p/345285#M102325</guid>
      <dc:creator>SplunkersRock</dc:creator>
      <dc:date>2017-04-25T17:23:53Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on finding daily hourly max for a month for a timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-on-finding-daily-hourly-max-for-a-month-for-a/m-p/345286#M102326</link>
      <description>&lt;P&gt;If you want to understand exactly what you are doing, and be able to answer your own questions with flexible strategies, then you are better off doing your own calculations, rather than just letting &lt;CODE&gt;timechart&lt;/CODE&gt; do the work.  Feed the results into &lt;CODE&gt;timechart&lt;/CODE&gt; at the very end, after you've collected the info.&lt;/P&gt;

&lt;P&gt;(Caveat... if you want to be able to change the time scale to investigate things, then you have to chunk the data to the lowest level you will want to get down to.)  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myIndex sourcetype=mysrctype
| bin _time as Hour span=1h
| stats count by myapps Hour
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now you have an hourly count for each value of myapps for each hour&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| bin Hour as Day span=1d  
| stats max(count) as maxcount by myapps Day
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now you have the highest hourly count for each value of myapps for each Day, so let's display it...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rename Day as _time
| timechart span=1d max(maxcount) as maxcount by myapps
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That uses &lt;CODE&gt;timechart&lt;/CODE&gt; to display the highest value for each day, as we have calculated it.&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;Now that you see all the above steps, here's a compressed way that accomplishes the same thing, letting &lt;CODE&gt;timechart&lt;/CODE&gt; do the final calculation step...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myIndex sourcetype=mysrctype
| bin _time span=1h
| stats count by myapps _time
| timechart span=1d max(count) as maxcount by myapps
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 25 Apr 2017 20:55:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-on-finding-daily-hourly-max-for-a-month-for-a/m-p/345286#M102326</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-04-25T20:55:12Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on finding daily hourly max for a month for a timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-on-finding-daily-hourly-max-for-a-month-for-a/m-p/345287#M102327</link>
      <description>&lt;P&gt;Wonderful explanation.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 21:02:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-on-finding-daily-hourly-max-for-a-month-for-a/m-p/345287#M102327</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-04-25T21:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: Need help on finding daily hourly max for a month for a timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-on-finding-daily-hourly-max-for-a-month-for-a/m-p/345288#M102328</link>
      <description>&lt;P&gt;Thanks a lot for your help. Its explained in a wonderful way.. I appreciate it a lot and hope to help others in the same way as you just did.. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 21:58:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-on-finding-daily-hourly-max-for-a-month-for-a/m-p/345288#M102328</guid>
      <dc:creator>payalgarg27</dc:creator>
      <dc:date>2017-04-25T21:58:33Z</dc:date>
    </item>
  </channel>
</rss>

