<?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: Comparing counts for different time ranges in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Comparing-counts-for-different-time-ranges/m-p/578479#M102137</link>
    <description>&lt;P&gt;Assuming you use &lt;STRONG&gt;| timechart&lt;/STRONG&gt;, you can immediately after use &lt;STRONG&gt;| timewrap&lt;/STRONG&gt; to let the display split by your favorite span.&lt;/P&gt;&lt;P&gt;For example :&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;... earliest=-1d @d | timechart count span=1h | timewrap 1h&lt;BR /&gt;... earliest=@w | timechart count span=1h | timewrap 1d&lt;BR /&gt;.. earliest=-4w@w | timechart count span=1d | timewrap 1d&lt;/PRE&gt;&lt;P&gt;Timewrap will automaticaly add new series with a suffix as &lt;STRONG&gt;...1hour_before ...2days_before&amp;nbsp; ... latest_day&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 15 Dec 2021 14:10:36 GMT</pubDate>
    <dc:creator>ldongradi_SPL</dc:creator>
    <dc:date>2021-12-15T14:10:36Z</dc:date>
    <item>
      <title>Comparing counts for different time ranges</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Comparing-counts-for-different-time-ranges/m-p/578444#M102130</link>
      <description>&lt;P&gt;Hi , when I'm deploying new changes to my services I want to compare the last day's error logs to the last week to see if there has been an increase for a specific message.&amp;nbsp; I have trouble figuring out how I display the counts for the different time ranges by message.&lt;BR /&gt;&lt;BR /&gt;This kind of gives the correct result but the same message for last and this week will not be grouped correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sourcetype="my pod" level="error" | eval marker = if (_time &amp;lt; relative_time(now(), "-1d@d"),
"lastweek", "thisweek") | multireport [where marker="thisweek" | stats count as this week by message] [where marker="lastweek" | stats count as last week by message]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Grateful for any help&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 11:24:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Comparing-counts-for-different-time-ranges/m-p/578444#M102130</guid>
      <dc:creator>queryaslan</dc:creator>
      <dc:date>2021-12-15T11:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing counts for different time ranges</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Comparing-counts-for-different-time-ranges/m-p/578446#M102131</link>
      <description>&lt;P&gt;It seems you're overthinking it a bit &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Just use bin if you want fixed buckets and then do your&lt;/P&gt;&lt;PRE&gt;stats count by message _time&lt;/PRE&gt;&lt;P&gt;Oh, and if you compare to "-1d@d", it's not "last week", it's "yesterday" &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 11:34:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Comparing-counts-for-different-time-ranges/m-p/578446#M102131</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-12-15T11:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing counts for different time ranges</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Comparing-counts-for-different-time-ranges/m-p/578453#M102132</link>
      <description>&lt;P&gt;To get counts for yesterday and the same day a week ago, you could do this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sourcetype="my pod" level="error" 
[| makeresults
| eval days=mvappend("0","7")
| mvexpand days
| eval earliest=relative_time(now(),"-".tostring(1+days)."d@d")
| eval latest=relative_time(now(),"-".tostring(days)."d@d")
| table earliest latest]
| bin _time span=1d
| stats count by _time message&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 15 Dec 2021 12:12:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Comparing-counts-for-different-time-ranges/m-p/578453#M102132</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-12-15T12:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing counts for different time ranges</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Comparing-counts-for-different-time-ranges/m-p/578457#M102133</link>
      <description>&lt;P&gt;Hmm won't bin group per _time range like this:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Message&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;_time&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="25px"&gt;failed&lt;/TD&gt;&lt;TD height="25px"&gt;2021-12-15&lt;/TD&gt;&lt;TD height="25px"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;failed&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;2021-12-14&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Which makes it impossible to compare a lot of different messages.&lt;BR /&gt;&lt;BR /&gt;So my wanted format is:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;Message&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;Count before release time&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;Count after release time&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%"&gt;failed&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;1&lt;/TD&gt;&lt;TD width="33.333333333333336%"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 15 Dec 2021 12:52:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Comparing-counts-for-different-time-ranges/m-p/578457#M102133</guid>
      <dc:creator>queryaslan</dc:creator>
      <dc:date>2021-12-15T12:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing counts for different time ranges</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Comparing-counts-for-different-time-ranges/m-p/578462#M102134</link>
      <description>&lt;P&gt;You have the values. Now all you need is to transform them to the proper format.&lt;/P&gt;&lt;P&gt;If you have them like this:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;Message&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;_time&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;count&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="25px"&gt;failed&lt;/TD&gt;&lt;TD height="25px"&gt;2021-12-15&lt;/TD&gt;&lt;TD height="25px"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;failed&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;2021-12-14&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can do&lt;/P&gt;&lt;PRE&gt;| xyseries Message _time count&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;To transform it to the table you want (ok, you'll still have ugly _time values so you might want to stftime it first).&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 13:09:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Comparing-counts-for-different-time-ranges/m-p/578462#M102134</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-12-15T13:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing counts for different time ranges</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Comparing-counts-for-different-time-ranges/m-p/578465#M102135</link>
      <description>&lt;LI-CODE lang="markup"&gt;sourcetype="my pod" level="error" 
[| makeresults
| eval days=mvappend("0","7")
| mvexpand days
| eval earliest=relative_time(now(),"-".tostring(1+days)."d@d")
| eval latest=relative_time(now(),"-".tostring(days)."d@d")
| table earliest latest]
| bin _time span=1d
| stats count by _time message
| eval time=if(_time&amp;lt;relative_time(now(),"-1d@d"),"Count before yesterday","Count yesterday")
| xyseries message time count&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 15 Dec 2021 13:21:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Comparing-counts-for-different-time-ranges/m-p/578465#M102135</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-12-15T13:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing counts for different time ranges</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Comparing-counts-for-different-time-ranges/m-p/578479#M102137</link>
      <description>&lt;P&gt;Assuming you use &lt;STRONG&gt;| timechart&lt;/STRONG&gt;, you can immediately after use &lt;STRONG&gt;| timewrap&lt;/STRONG&gt; to let the display split by your favorite span.&lt;/P&gt;&lt;P&gt;For example :&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;... earliest=-1d @d | timechart count span=1h | timewrap 1h&lt;BR /&gt;... earliest=@w | timechart count span=1h | timewrap 1d&lt;BR /&gt;.. earliest=-4w@w | timechart count span=1d | timewrap 1d&lt;/PRE&gt;&lt;P&gt;Timewrap will automaticaly add new series with a suffix as &lt;STRONG&gt;...1hour_before ...2days_before&amp;nbsp; ... latest_day&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 14:10:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Comparing-counts-for-different-time-ranges/m-p/578479#M102137</guid>
      <dc:creator>ldongradi_SPL</dc:creator>
      <dc:date>2021-12-15T14:10:36Z</dc:date>
    </item>
  </channel>
</rss>

