<?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: timechart comparison for 15 mints current working day vs previous working day in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/timechart-comparison-for-15-mints-current-working-day-vs/m-p/675194#M231053</link>
    <description>&lt;PRE&gt;| tstats count where index=&amp;lt;your-index-here&amp;gt; earliest=-3d@d latest=now() by _time span=15m &lt;BR /&gt;| eval date_wday=strftime(_time,"%A"), date_hourmin=strftime(_time,"%H:%M")&lt;BR /&gt;| search date_wday!=Saturday date_wday!=Sunday &lt;BR /&gt;| eval current_weekday=strftime(now(),"%A") &lt;BR /&gt;| eval previous_working_day=case(match(current_weekday,"Monday"),"Friday",match(current_weekday,"Tuesday"),"Monday",match(current_weekday,"Wednesday"),"Tuesday",match(current_weekday,"Thursday"),"Wednesday",match(current_weekday,"Friday"),"Thursday") &lt;BR /&gt;| table _time count date_wday date_hourmin current_weekday previous_working_day&lt;BR /&gt;| where date_wday=current_weekday OR date_wday=previous_working_day&lt;BR /&gt;| chart sum(count) as count by date_hourmin, date_wday&lt;/PRE&gt;&lt;P&gt;Ok that is the closest I could get to what you originally tried.&amp;nbsp; However, there are some flaws with this solution you may want to consider.&amp;nbsp; Specifically partial time bins can not be filtered out without using the time chart command.&amp;nbsp; So it could look like the count for the most recent time span has dangerously dropped when in reality you only have 2 or 3 minutes of the 15 minute window to measure.&lt;/P&gt;&lt;P&gt;Working with the timewrap command is more correct way to do this as you can leverage timechart which allows you to disable partial windows.&amp;nbsp; You will find though that filtering out week-ends and the &lt;A href="mailto:-3d@d" target="_blank"&gt;-3d@d&lt;/A&gt;&amp;nbsp;makes for odd visualizations.&lt;/P&gt;&lt;PRE&gt;index=&amp;lt;your-index-here&amp;gt; date_wday!=saturday date_wday!=sunday earliest=-3d@d latest=+1d@d&lt;BR /&gt;| timechart span=15m partial=f count&lt;BR /&gt;| timewrap 1day align=end&lt;/PRE&gt;&lt;P&gt;Splunk time extracts date_* fields for you already.&amp;nbsp; The &lt;A href="mailto:+1d@d" target="_blank"&gt;+1d@d&lt;/A&gt;&amp;nbsp;is only important if you want your graph to go midnight to midnight, replace with now() if you are ok with the visualization start and end moving as the day progresses.&lt;/P&gt;</description>
    <pubDate>Tue, 23 Jan 2024 16:04:19 GMT</pubDate>
    <dc:creator>dural_yyz</dc:creator>
    <dc:date>2024-01-23T16:04:19Z</dc:date>
    <item>
      <title>timechart comparison for 15 mints current working day vs previous working day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/timechart-comparison-for-15-mints-current-working-day-vs/m-p/675163#M231043</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have the below SPL and I would like to get the comparison for 15 mints time span i.e if we run today at 5 am&amp;nbsp; then we should expect the table like for every 15 mints data count vs yesterday same time count. Please could you help?&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Current SPL:

basesearch earliest=-3d@d latest=now
| eval date_wday=strftime(_time,"%A")

|search NOT (date_wday=Saturday OR date_wday=Sunday)
| eval last_weekday=strftime(now(),"%A")
| eval previous_working_day=case(match(last_weekday,"Monday"),"Friday",match(last_weekday,"Tuesday"),"Monday",match(last_weekday,"Wednesday"),"Tuesday",match(last_weekday,"Thursday"),"Wednesday",match(last_weekday,"Friday"),"Thursday")
| where date_wday=last_weekday OR date_wday=previous_working_day
| eval DAY=if(date_wday=last_weekday,"TODAY","YESTERDAY")
| chart count by Name,DAY
| eval percentage_variance=abs(round(((YESTERDAY-TODAY)/YESTERDAY)*100,2))
| table Name TODAY YESTERDAY percentage_variance&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2024 12:53:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/timechart-comparison-for-15-mints-current-working-day-vs/m-p/675163#M231043</guid>
      <dc:creator>selvam_sekar</dc:creator>
      <dc:date>2024-01-23T12:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: timechart comparison for 15 mints current working day vs previous working day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/timechart-comparison-for-15-mints-current-working-day-vs/m-p/675171#M231046</link>
      <description>&lt;P&gt;Have a look at the timewrap command&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/SCS/current/SearchReference/TimewrapCommandOverview" target="_blank"&gt;timewrap command overview - Splunk Documentation&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2024 13:31:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/timechart-comparison-for-15-mints-current-working-day-vs/m-p/675171#M231046</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-01-23T13:31:40Z</dc:date>
    </item>
    <item>
      <title>Re: timechart comparison for 15 mints current working day vs previous working day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/timechart-comparison-for-15-mints-current-working-day-vs/m-p/675194#M231053</link>
      <description>&lt;PRE&gt;| tstats count where index=&amp;lt;your-index-here&amp;gt; earliest=-3d@d latest=now() by _time span=15m &lt;BR /&gt;| eval date_wday=strftime(_time,"%A"), date_hourmin=strftime(_time,"%H:%M")&lt;BR /&gt;| search date_wday!=Saturday date_wday!=Sunday &lt;BR /&gt;| eval current_weekday=strftime(now(),"%A") &lt;BR /&gt;| eval previous_working_day=case(match(current_weekday,"Monday"),"Friday",match(current_weekday,"Tuesday"),"Monday",match(current_weekday,"Wednesday"),"Tuesday",match(current_weekday,"Thursday"),"Wednesday",match(current_weekday,"Friday"),"Thursday") &lt;BR /&gt;| table _time count date_wday date_hourmin current_weekday previous_working_day&lt;BR /&gt;| where date_wday=current_weekday OR date_wday=previous_working_day&lt;BR /&gt;| chart sum(count) as count by date_hourmin, date_wday&lt;/PRE&gt;&lt;P&gt;Ok that is the closest I could get to what you originally tried.&amp;nbsp; However, there are some flaws with this solution you may want to consider.&amp;nbsp; Specifically partial time bins can not be filtered out without using the time chart command.&amp;nbsp; So it could look like the count for the most recent time span has dangerously dropped when in reality you only have 2 or 3 minutes of the 15 minute window to measure.&lt;/P&gt;&lt;P&gt;Working with the timewrap command is more correct way to do this as you can leverage timechart which allows you to disable partial windows.&amp;nbsp; You will find though that filtering out week-ends and the &lt;A href="mailto:-3d@d" target="_blank"&gt;-3d@d&lt;/A&gt;&amp;nbsp;makes for odd visualizations.&lt;/P&gt;&lt;PRE&gt;index=&amp;lt;your-index-here&amp;gt; date_wday!=saturday date_wday!=sunday earliest=-3d@d latest=+1d@d&lt;BR /&gt;| timechart span=15m partial=f count&lt;BR /&gt;| timewrap 1day align=end&lt;/PRE&gt;&lt;P&gt;Splunk time extracts date_* fields for you already.&amp;nbsp; The &lt;A href="mailto:+1d@d" target="_blank"&gt;+1d@d&lt;/A&gt;&amp;nbsp;is only important if you want your graph to go midnight to midnight, replace with now() if you are ok with the visualization start and end moving as the day progresses.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2024 16:04:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/timechart-comparison-for-15-mints-current-working-day-vs/m-p/675194#M231053</guid>
      <dc:creator>dural_yyz</dc:creator>
      <dc:date>2024-01-23T16:04:19Z</dc:date>
    </item>
  </channel>
</rss>

