<?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: query to consider having an event if its available in any specific weekday in the given time range in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/query-to-consider-having-an-event-if-its-available-in-any/m-p/583614#M10372</link>
    <description>&lt;P&gt;You can do a simple trick - do a (modulo 86400*7) on the _time field. This way you'll "compress" all your events to the period of 1-7 Jan 1970. Then you'll be able to sort it anyway you want &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; (you might also offset it with any multiple of 86400 if you don't like the starting weekday).&lt;/P&gt;</description>
    <pubDate>Thu, 03 Feb 2022 17:26:11 GMT</pubDate>
    <dc:creator>PickleRick</dc:creator>
    <dc:date>2022-02-03T17:26:11Z</dc:date>
    <item>
      <title>query to consider having an event if its available in any specific weekday in the given time range</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/query-to-consider-having-an-event-if-its-available-in-any/m-p/583572#M10364</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;So the requirement was to find gaps of data unavailability(start time &amp;amp; end time)&amp;nbsp; in the&amp;nbsp; given time range, condition is that if specific weekday have event in&amp;nbsp; a certain period (say first week of Sunday) and in the same period if other week of same weekday(say Second week of Sunday)&amp;nbsp; does not have an event then my search still have to consider of having an event during Second Sunday too for calculating duration of data unavailability.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 15:04:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/query-to-consider-having-an-event-if-its-available-in-any/m-p/583572#M10364</guid>
      <dc:creator>Dhana</dc:creator>
      <dc:date>2022-02-03T15:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: query to consider having an event if its available in any specific weekday in the given time range</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/query-to-consider-having-an-event-if-its-available-in-any/m-p/583575#M10365</link>
      <description>&lt;P&gt;Can you give an example of the events you are expecting Splunk to show?&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 15:09:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/query-to-consider-having-an-event-if-its-available-in-any/m-p/583575#M10365</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-02-03T15:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: query to consider having an event if its available in any specific weekday in the given time range</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/query-to-consider-having-an-event-if-its-available-in-any/m-p/583591#M10366</link>
      <description>&lt;P&gt;Sunday Feb 1 - events at 10:00,10:04,11:00&lt;BR /&gt;Monday Feb 2nd - events at 9:00,9:01,9:04&lt;BR /&gt;Tuesday Feb 3rd - events 0&lt;BR /&gt;'&lt;BR /&gt;'&lt;BR /&gt;'&lt;BR /&gt;'&lt;BR /&gt;'&lt;BR /&gt;Sunday Feb 8- events at 9:00, 12:00&lt;BR /&gt;Monday Feb 9 - 0 events&lt;BR /&gt;Tuesday Feb 10 - events at 7:00&lt;/P&gt;&lt;P&gt;so in the given search span (time range can be anything, maybe 30 days, 90days etc), my search should least bother about the date. main concern is weekday and Time&lt;/P&gt;&lt;P&gt;data unavailability reporting&amp;nbsp; results expected&lt;/P&gt;&lt;P&gt;Sunday at 0 through sunday at 8:59 [539 minutes]&lt;BR /&gt;Sunday at 9:01 through sunday at 9:59 [duration b/w 9:01 to 9:59 minutes]&lt;BR /&gt;Sunday at 10:01 through sunday at 10:03&lt;BR /&gt;Sunday at 10:05 through sunday at 10:59&lt;BR /&gt;Sunday at 11:01 through sunday at 11:59&lt;BR /&gt;Sunday at 12:01 through Monday at 08:59&lt;BR /&gt;Monday at 09:02 through Monday at 09:03&lt;BR /&gt;Monday at 09:05 through Tuesday at 06:59&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 15:45:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/query-to-consider-having-an-event-if-its-available-in-any/m-p/583591#M10366</guid>
      <dc:creator>Dhana</dc:creator>
      <dc:date>2022-02-03T15:45:06Z</dc:date>
    </item>
    <item>
      <title>Re: query to consider having an event if its available in any specific weekday in the given time range</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/query-to-consider-having-an-event-if-its-available-in-any/m-p/583592#M10367</link>
      <description>&lt;P&gt;OK, it's relatively easy - you group the events by weekday and time within the day and find event periods. But what's the use case? Because it seems a bit pointless to aggregate events over several different weeks.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 16:10:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/query-to-consider-having-an-event-if-its-available-in-any/m-p/583592#M10367</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-02-03T16:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: query to consider having an event if its available in any specific weekday in the given time range</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/query-to-consider-having-an-event-if-its-available-in-any/m-p/583594#M10368</link>
      <description>&lt;P&gt;I got till the point of getting down to find the gap, but not quite getting to boil down to grouping weekdays and merging same weekday events to one to replace the time range which don't have events with one which have.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=*&lt;BR /&gt;| timechart count(_raw) as events span=1m&lt;BR /&gt;| eval Availability=if(events=1,"1","0")&lt;BR /&gt;| streamstats count(eval(Availability=1)) as unique_count&lt;BR /&gt;| delta _time as Duration&lt;BR /&gt;| search Availability=0&lt;BR /&gt;| stats earliest(_time) as From sum(Duration) as Duration by Availability unique_count&lt;BR /&gt;| eval Duration1=Duration-60&lt;BR /&gt;| eval To=strftime(From+Duration1,"%c"), From=strftime(From,"%c")&lt;BR /&gt;| where Duration&amp;gt;300&lt;BR /&gt;| fields Availability From To Duration&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 16:19:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/query-to-consider-having-an-event-if-its-available-in-any/m-p/583594#M10368</guid>
      <dc:creator>Dhana</dc:creator>
      <dc:date>2022-02-03T16:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: query to consider having an event if its available in any specific weekday in the given time range</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/query-to-consider-having-an-event-if-its-available-in-any/m-p/583595#M10369</link>
      <description>&lt;P&gt;I'd approach that from a completely different end.&lt;/P&gt;&lt;P&gt;Firstly render your _time into weekday and time, then count.&lt;/P&gt;&lt;P&gt;Then find gaps.&lt;/P&gt;&lt;P&gt;At the end you might need to adjust it for the week wraparound.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 16:23:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/query-to-consider-having-an-event-if-its-available-in-any/m-p/583595#M10369</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-02-03T16:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: query to consider having an event if its available in any specific weekday in the given time range</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/query-to-consider-having-an-event-if-its-available-in-any/m-p/583600#M10370</link>
      <description>&lt;P&gt;yeah, I have tried the path. I could not able to get to the part of considering having the events for weekday if they have in other.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=**&lt;BR /&gt;| timechart count(_raw) as events span=1m&lt;BR /&gt;| eval Time=strftime(_time,"%A %T")&lt;BR /&gt;| stats count by Time events&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 16:46:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/query-to-consider-having-an-event-if-its-available-in-any/m-p/583600#M10370</guid>
      <dc:creator>Dhana</dc:creator>
      <dc:date>2022-02-03T16:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: query to consider having an event if its available in any specific weekday in the given time range</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/query-to-consider-having-an-event-if-its-available-in-any/m-p/583604#M10371</link>
      <description>&lt;LI-CODE lang="markup"&gt;index=_internal sourcetype=splunkd_ui_access 
``` using internal as runanywhere example ```
``` start with timechart to generate events for each minute (span=1m) within time period of search ```
| timechart count span=1m by date_wday 
``` untable to get table of events ```
| untable _time weekday count
``` evaluate time for day of the week (used to maintain order) weekday (for display purposes) hour and minute ```
| eval weekday = strftime(_time,"%A")
| eval daynumber = strftime(_time,"%w")
| eval hour = strftime(_time,"%H")
| eval minute = strftime(_time,"%M")
``` sum the counts to find periods of zero activity ```
| stats sum(count) as count by daynumber weekday hour minute
| where count = 0
``` calculate minute into each day ```
| eval minuteofday=minute+(hour*60)
``` find consecutive minutes of inactivity ```
| streamstats  window=2 global=f range(minuteofday) as consecutive by daynumber weekday
``` anything other than 1 is the start of day or start of new period on inactivity ```
| eval start=if(consecutive == 1, 0, 1)
``` number groups of inactivity through day ```
| streamstats  global=f sum(start) as group by weekday daynumber
``` find start time and end time of inactivity ```
| stats min(minuteofday) as periodstart max(minuteofday) as periodend by daynumber weekday group
``` convert start and end times to hours and minutes ```
| eval periodstart=printf("%02d:%02d",floor(periodstart/60),periodstart%60)
| eval periodend=printf("%02d:%02d",floor(periodend/60),periodend%60)
``` Robert is your father's brother! ```&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 03 Feb 2022 17:05:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/query-to-consider-having-an-event-if-its-available-in-any/m-p/583604#M10371</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-02-03T17:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: query to consider having an event if its available in any specific weekday in the given time range</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/query-to-consider-having-an-event-if-its-available-in-any/m-p/583614#M10372</link>
      <description>&lt;P&gt;You can do a simple trick - do a (modulo 86400*7) on the _time field. This way you'll "compress" all your events to the period of 1-7 Jan 1970. Then you'll be able to sort it anyway you want &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; (you might also offset it with any multiple of 86400 if you don't like the starting weekday).&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 17:26:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/query-to-consider-having-an-event-if-its-available-in-any/m-p/583614#M10372</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-02-03T17:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: query to consider having an event if its available in any specific weekday in the given time range</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/query-to-consider-having-an-event-if-its-available-in-any/m-p/583985#M10373</link>
      <description>&lt;P&gt;Thank you so much&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;, It helped.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 17:27:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/query-to-consider-having-an-event-if-its-available-in-any/m-p/583985#M10373</guid>
      <dc:creator>Dhana</dc:creator>
      <dc:date>2022-02-07T17:27:48Z</dc:date>
    </item>
  </channel>
</rss>

