<?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 XQL - &amp;quot;After hours&amp;quot; query in Cortex XDR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-quot-after-hours-quot-query/m-p/1238330#M8738</link>
    <description>&lt;P&gt;This is a fairly dataset agnostic query snippet to look for events "after hours". You'll need to define what that means and also convert the time zone to your local time. This might not work if you're using UTC in the console, I'm not sure there.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It took me some doing to get this working correctly and it's a common thing someone might want to use for an investigation or dashboard.. so here you go&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;| alter Local_Time = parse_timestamp("%Y/%m/%d %H:%M:%S", format_timestamp("%Y/%m/%d %H:%M:%S", _time,"America/Los_Angeles"),"UTC")&lt;BR /&gt;| alter event_hour = extract_time(Local_Time , "HOUR"), event_day = extract_time(Local_Time , "DAYOFWEEK")&lt;BR /&gt;| filter (&lt;BR /&gt;&amp;nbsp; &amp;nbsp;(event_day in (1, 7)) // Saturday (7) or Sunday (1)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;or&lt;BR /&gt;&amp;nbsp; &amp;nbsp;(event_day in (2, 3, 4, 5,6) and (event_hour &amp;lt; 6 or event_hour &amp;gt;= 17)) // M–F but outside 6am-5pm&lt;BR /&gt;&amp;nbsp;)//end filter&lt;/P&gt;
&lt;P&gt;|fields _time, Local_Time , event_hour , event_day&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That field set should help you confirm its return the correct results before you drive on. Comment out the filter above and make sure the local time matches your _time and the hour and day also lines up. From what I can tell Sunday starts at 1 and Sat is 7, but ymmv.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 18 Sep 2025 20:08:00 GMT</pubDate>
    <dc:creator>Jesse_Siegrist</dc:creator>
    <dc:date>2025-09-18T20:08:00Z</dc:date>
    <item>
      <title>XQL - "After hours" query</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-quot-after-hours-quot-query/m-p/1238330#M8738</link>
      <description>&lt;P&gt;This is a fairly dataset agnostic query snippet to look for events "after hours". You'll need to define what that means and also convert the time zone to your local time. This might not work if you're using UTC in the console, I'm not sure there.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It took me some doing to get this working correctly and it's a common thing someone might want to use for an investigation or dashboard.. so here you go&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;| alter Local_Time = parse_timestamp("%Y/%m/%d %H:%M:%S", format_timestamp("%Y/%m/%d %H:%M:%S", _time,"America/Los_Angeles"),"UTC")&lt;BR /&gt;| alter event_hour = extract_time(Local_Time , "HOUR"), event_day = extract_time(Local_Time , "DAYOFWEEK")&lt;BR /&gt;| filter (&lt;BR /&gt;&amp;nbsp; &amp;nbsp;(event_day in (1, 7)) // Saturday (7) or Sunday (1)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;or&lt;BR /&gt;&amp;nbsp; &amp;nbsp;(event_day in (2, 3, 4, 5,6) and (event_hour &amp;lt; 6 or event_hour &amp;gt;= 17)) // M–F but outside 6am-5pm&lt;BR /&gt;&amp;nbsp;)//end filter&lt;/P&gt;
&lt;P&gt;|fields _time, Local_Time , event_hour , event_day&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That field set should help you confirm its return the correct results before you drive on. Comment out the filter above and make sure the local time matches your _time and the hour and day also lines up. From what I can tell Sunday starts at 1 and Sat is 7, but ymmv.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Sep 2025 20:08:00 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-quot-after-hours-quot-query/m-p/1238330#M8738</guid>
      <dc:creator>Jesse_Siegrist</dc:creator>
      <dc:date>2025-09-18T20:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: XQL - "After hours" query</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-quot-after-hours-quot-query/m-p/1238388#M8743</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/259674"&gt;@Jesse_Siegrist&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Glad to hear that this is working. We really appreciate the contribution of every user here in this forum&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;KR,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Luis&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Sep 2025 14:01:07 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-quot-after-hours-quot-query/m-p/1238388#M8743</guid>
      <dc:creator>eluis</dc:creator>
      <dc:date>2025-09-19T14:01:07Z</dc:date>
    </item>
  </channel>
</rss>

