<?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 with streamstats search -- need to display _time on x-axis. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-streamstats-search-need-to-display-time-on-x-axis/m-p/323646#M96627</link>
    <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo | timechart span=15m count  | eval day=relative_time(_time,"@d") | streamstats sum(count) as totalCount  by day |table _time, totalCount | eval _time=strftime(_time, "%m/%d %H:%M")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 05 Sep 2017 21:22:22 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2017-09-05T21:22:22Z</dc:date>
    <item>
      <title>Need help with streamstats search -- need to display _time on x-axis.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-streamstats-search-need-to-display-time-on-x-axis/m-p/323645#M96626</link>
      <description>&lt;P&gt;I have a requirement to display the count of data received over the last 7 days.  I need to show the total with a data point every 15 minutes and the count should reset (start over at 0) at midnight.  (The graph looks like a saw tooth, growing til midnight then a line down to 0 and starting to grow again).  The search I have is working great.  I just need to somehow display the time (mm/dd hh:mm) on the x-axis.&lt;/P&gt;

&lt;P&gt;This is my search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo | timechart span=15m count as count | addtotals fieldname=count | eval time=strftime(_time,"%H:%M") | streamstats sum(count) as totalCount  reset_after="("match(time,\"23:45\")")" |table _time, totalCount | eval _time=strftime(_time, "%m/%d %H:%M")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This generates the correct data points, but there are no labels on the x-axis where I'd like the _time to display.  Currently the user must hover over a datapoint to see what date they are looking at. &lt;BR /&gt;
Any ideas?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Sep 2017 21:13:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-streamstats-search-need-to-display-time-on-x-axis/m-p/323645#M96626</guid>
      <dc:creator>lyndac</dc:creator>
      <dc:date>2017-09-05T21:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with streamstats search -- need to display _time on x-axis.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Need-help-with-streamstats-search-need-to-display-time-on-x-axis/m-p/323646#M96627</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo | timechart span=15m count  | eval day=relative_time(_time,"@d") | streamstats sum(count) as totalCount  by day |table _time, totalCount | eval _time=strftime(_time, "%m/%d %H:%M")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Sep 2017 21:22:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Need-help-with-streamstats-search-need-to-display-time-on-x-axis/m-p/323646#M96627</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-09-05T21:22:22Z</dc:date>
    </item>
  </channel>
</rss>

