<?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: Day to day comparison. Using stats and timechart. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Day-to-day-comparison-Using-stats-and-timechart/m-p/420460#M170751</link>
    <description>&lt;P&gt;No, this is what I am looking for.&lt;/P&gt;

&lt;P&gt;Hours AverageCount  TodaysCount&lt;BR /&gt;
00                4                        0&lt;BR /&gt;
01                0                        3&lt;BR /&gt;
02                5                        2&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
24               0                         0&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jun 2019 17:27:04 GMT</pubDate>
    <dc:creator>sandeepmakkena</dc:creator>
    <dc:date>2019-06-12T17:27:04Z</dc:date>
    <item>
      <title>Day to day comparison. Using stats and timechart.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Day-to-day-comparison-Using-stats-and-timechart/m-p/420458#M170749</link>
      <description>&lt;P&gt;sourcetype="SysEvents" OR sourcetype="Sysout" TransactionId=TI* AND TransactionId!=TI earliest=-d@d latest=@d&lt;BR /&gt;
| timechart span=1h count&lt;BR /&gt;
| eval Hour = strftime(_time, "%H")&lt;BR /&gt;
| stats avg(count) as AverageCount by Hour&lt;BR /&gt;
|  join Hour&lt;BR /&gt;
    [sourcetype="SysEvents" OR sourcetype="Sysout" TransactionId=TI* AND TransactionId!=TI AND TransactionId!=OPF earliest=@d latest=@h&lt;BR /&gt;
    | timechart span=1h count&lt;BR /&gt;
    | eval Hour = strftime(_time, "%H")&lt;BR /&gt;
    | stats count as TodaysCount by Hour]&lt;/P&gt;

&lt;P&gt;It seems to be working fine, but it doesn't show any results if one of the search period doesn't have any results.&lt;/P&gt;

&lt;P&gt;No, this is what I am looking something like this and display this stats on time chart.&lt;/P&gt;

&lt;P&gt;Hours AverageCount  TodaysCount&lt;BR /&gt;
00                4                        0&lt;BR /&gt;
01                0                        3&lt;BR /&gt;
02                5                        2&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
24               0                         0&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:53:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Day-to-day-comparison-Using-stats-and-timechart/m-p/420458#M170749</guid>
      <dc:creator>sandeepmakkena</dc:creator>
      <dc:date>2020-09-30T00:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: Day to day comparison. Using stats and timechart.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Day-to-day-comparison-Using-stats-and-timechart/m-p/420459#M170750</link>
      <description>&lt;P&gt;Try &lt;CODE&gt;append&lt;/CODE&gt; with &lt;CODE&gt;stats&lt;/CODE&gt;. Also, I'm not sure how this is running without a &lt;CODE&gt;search&lt;/CODE&gt; command inside the subsearch.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="SysEvents" OR sourcetype="Sysout" TransactionId=TI* AND TransactionId!=TI earliest=-d@d latest=@d
| timechart span=1h count
| eval Hour = strftime(_time, "%H")
| stats avg(count) as AverageCount by Hour
| append
[search sourcetype="SysEvents" OR sourcetype="Sysout" TransactionId=TI* AND TransactionId!=TI AND TransactionId!=OPF earliest=@d latest=@h
| timechart span=1h count
| eval Hour = strftime(_time, "%H")
| stats count as TodaysCount by Hour]
| stats min(AverageCount) as AverageCount, min(TodaysCount) as TodaysCount by Hour | fillnull value=0 AverageCount TodaysCount
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Jun 2019 15:39:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Day-to-day-comparison-Using-stats-and-timechart/m-p/420459#M170750</guid>
      <dc:creator>grittonc</dc:creator>
      <dc:date>2019-06-12T15:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: Day to day comparison. Using stats and timechart.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Day-to-day-comparison-Using-stats-and-timechart/m-p/420460#M170751</link>
      <description>&lt;P&gt;No, this is what I am looking for.&lt;/P&gt;

&lt;P&gt;Hours AverageCount  TodaysCount&lt;BR /&gt;
00                4                        0&lt;BR /&gt;
01                0                        3&lt;BR /&gt;
02                5                        2&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
.&lt;BR /&gt;
24               0                         0&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2019 17:27:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Day-to-day-comparison-Using-stats-and-timechart/m-p/420460#M170751</guid>
      <dc:creator>sandeepmakkena</dc:creator>
      <dc:date>2019-06-12T17:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Day to day comparison. Using stats and timechart.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Day-to-day-comparison-Using-stats-and-timechart/m-p/420461#M170752</link>
      <description>&lt;P&gt;You should checkout &lt;CODE&gt;timewrap&lt;/CODE&gt;. This will do exactly what you need. It should always be passed after  &lt;CODE&gt;timechart&lt;/CODE&gt; command like this.. Make sure to set your timerange to something like the last 7 days so you can get 7 lines showing day over day&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="SysEvents" OR sourcetype="Sysout" TransactionId=TI* AND TransactionId!=TI earliest=-7d@d latest=@d
| timechart span=1h count
| timewrap 1d
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 12 Jun 2019 18:03:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Day-to-day-comparison-Using-stats-and-timechart/m-p/420461#M170752</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2019-06-12T18:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: Day to day comparison. Using stats and timechart.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Day-to-day-comparison-Using-stats-and-timechart/m-p/420462#M170753</link>
      <description>&lt;P&gt;I am sorry it did work, but it doesn't display anything if both the time ranges don't have any transactions. &lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 14:42:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Day-to-day-comparison-Using-stats-and-timechart/m-p/420462#M170753</guid>
      <dc:creator>sandeepmakkena</dc:creator>
      <dc:date>2019-06-13T14:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: Day to day comparison. Using stats and timechart.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Day-to-day-comparison-Using-stats-and-timechart/m-p/420463#M170754</link>
      <description>&lt;P&gt;This is a very expensive search, you should look into leaning it out&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 14:52:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Day-to-day-comparison-Using-stats-and-timechart/m-p/420463#M170754</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2019-06-13T14:52:04Z</dc:date>
    </item>
  </channel>
</rss>

