<?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: why timechart is not working in this query? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/why-timechart-is-not-working-in-this-query/m-p/399639#M115849</link>
    <description>&lt;P&gt;Hi @richgalloway But one problem with this new query... Now it is giving the sum of fails only in the earliest hour (ie. has the sum of all the 5 hours), all the ther rows have tie stamp for each hour but the sum of Fails is null against them.. Can you please suggest what should I use instead of min(_time) in stats?&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jul 2019 17:46:46 GMT</pubDate>
    <dc:creator>amaurya1</dc:creator>
    <dc:date>2019-07-17T17:46:46Z</dc:date>
    <item>
      <title>why timechart is not working in this query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/why-timechart-is-not-working-in-this-query/m-p/399636#M115846</link>
      <description>&lt;P&gt;index=abc sourcetype=xyz earliest=-65h latest=-61h&lt;BR /&gt;
|stats count as Fail by school&lt;BR /&gt;
|where  like (school, "%public%")&lt;BR /&gt;
|timechart span=1h sum(Fail) as Fail&lt;/P&gt;

&lt;P&gt;I want to get the sum of fails per hour but I don't know why it is showing "no result" as the output. If I use stats instead of timechart (stats sum(Fail) as Fail), then it gives me the total sum of fails but since I want per hour count therefore I wanted to have timechart in the query.&lt;BR /&gt;
Can someone please help?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 17:19:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/why-timechart-is-not-working-in-this-query/m-p/399636#M115846</guid>
      <dc:creator>amaurya1</dc:creator>
      <dc:date>2019-07-17T17:19:03Z</dc:date>
    </item>
    <item>
      <title>Re: why timechart is not working in this query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/why-timechart-is-not-working-in-this-query/m-p/399637#M115847</link>
      <description>&lt;P&gt;The &lt;CODE&gt;stats&lt;/CODE&gt; command filters out all fields except those used in its arguments so there is no _time field for &lt;CODE&gt;timechart&lt;/CODE&gt; to use.&lt;/P&gt;

&lt;P&gt;Try this query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=abc sourcetype=abc school="*public*" | bin span=1h _time
|stats count as Fail by _time host
| timechart span=1h sum(Fail) as Fail
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Jul 2019 17:31:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/why-timechart-is-not-working-in-this-query/m-p/399637#M115847</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-07-17T17:31:22Z</dc:date>
    </item>
    <item>
      <title>Re: why timechart is not working in this query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/why-timechart-is-not-working-in-this-query/m-p/399638#M115848</link>
      <description>&lt;P&gt;Hi @richgalloway thanks for your answer.. yes you are correct, the first stats comment removed the time field. I've update the query and now it's working fine. &lt;/P&gt;

&lt;P&gt;index=abc sourcetype=xyz earliest=-65h latest=-61h&lt;BR /&gt;
|stats min(_time) as _time, count as Fail by school&lt;BR /&gt;
|where like (school, "%public%")&lt;BR /&gt;
|timechart span=1h sum(Fail) as Fail&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 17:38:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/why-timechart-is-not-working-in-this-query/m-p/399638#M115848</guid>
      <dc:creator>amaurya1</dc:creator>
      <dc:date>2019-07-17T17:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: why timechart is not working in this query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/why-timechart-is-not-working-in-this-query/m-p/399639#M115849</link>
      <description>&lt;P&gt;Hi @richgalloway But one problem with this new query... Now it is giving the sum of fails only in the earliest hour (ie. has the sum of all the 5 hours), all the ther rows have tie stamp for each hour but the sum of Fails is null against them.. Can you please suggest what should I use instead of min(_time) in stats?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 17:46:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/why-timechart-is-not-working-in-this-query/m-p/399639#M115849</guid>
      <dc:creator>amaurya1</dc:creator>
      <dc:date>2019-07-17T17:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: why timechart is not working in this query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/why-timechart-is-not-working-in-this-query/m-p/399640#M115850</link>
      <description>&lt;P&gt;Have you tried my query?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 23:32:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/why-timechart-is-not-working-in-this-query/m-p/399640#M115850</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-07-17T23:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: why timechart is not working in this query?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/why-timechart-is-not-working-in-this-query/m-p/399641#M115851</link>
      <description>&lt;P&gt;Yeah.. I tried that one and it's working fine.. I'll use yours.. thanks&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 16:08:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/why-timechart-is-not-working-in-this-query/m-p/399641#M115851</guid>
      <dc:creator>amaurya1</dc:creator>
      <dc:date>2019-07-18T16:08:24Z</dc:date>
    </item>
  </channel>
</rss>

