<?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 Help with t XQL BIOC/Correlation  rule in Cortex XDR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/help-with-t-xql-bioc-correlation-rule/m-p/555498#M5044</link>
    <description>&lt;P&gt;Hi ALL,&lt;BR /&gt;&lt;BR /&gt;New to XDR world,&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am have a XQL query against a 2FA log which looks for user login (fail or success) from 2 different countries in 3 hours.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Query looks like&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;dataset in (XXX_raw) &lt;BR /&gt;| filter eventType = "User.Login" // look for&amp;nbsp; login events&lt;BR /&gt;| comp min(_time) as Firsttime, max(_time) as Lasttime, count_distinct(country) as location_count, values(state) AS states, values(city) AS cities , values(result) AS results by user_name&lt;BR /&gt;| filter location_count &amp;gt; 1 and timestamp_diff(Lasttime, Firsttime, "HOUR") &amp;lt; 3&lt;BR /&gt;&lt;BR /&gt;Things are fine the "Query Builder" now I want to move it to an alert/rule.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Looks like I can't set&amp;nbsp; BIOC rules bcoz&lt;BR /&gt;&lt;STRONG&gt;"you can create BIOC rules using the&amp;nbsp;&lt;CODE class="computeroutput hljs language-undefined"&gt;xdr_data&lt;/CODE&gt;&amp;nbsp;and&amp;nbsp;&lt;CODE class="computeroutput hljs language-undefined"&gt;cloud_audit_log&lt;/CODE&gt;&amp;nbsp;datasets and presets for these datasets. Currently, you cannot create a BIOC rule on customized datasets and only the&amp;nbsp;&lt;CODE class="computeroutput hljs language-css"&gt;&lt;SPAN class="hljs-attribute"&gt;filter&lt;/SPAN&gt;&lt;/CODE&gt;&amp;nbsp;stage,&amp;nbsp;&lt;CODE class="computeroutput hljs language-sql"&gt;&lt;SPAN class="hljs-keyword"&gt;alter&lt;/SPAN&gt;&lt;/CODE&gt;&amp;nbsp;stage, and functions without any aggregations are supported for XQL queries that define a BIOC" - &lt;A href="https://docs-cortex.paloaltonetworks.com/r/Cortex-XDR/Cortex-XDR-Pro-Administrator-Guide/BIOC-Rule-Details" target="_self"&gt;Ref link&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;So what are my options here? can i create "Correlation rules"?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Plan is to go down the "Correlation rules" path, but as per definition&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Correlation Rules help you analyze correlations of &lt;U&gt;multi-events from multiple sources&lt;/U&gt; by using the&amp;nbsp;&lt;SPAN class="phrase"&gt;Cortex Query Language&lt;/SPAN&gt;&amp;nbsp;(XQL) - &lt;A href="https://docs-cortex.paloaltonetworks.com/r/Cortex-XDR/Cortex-XDR-Pro-Administrator-Guide/Working-with-Correlation-Rules" target="_self"&gt;Ref link&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;does it really need to be "multiple source" (mine is multi event from same source) ?&amp;nbsp;Is there any gottcha I need to consider?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If any body been on similar situation, any thoughts guidance and help will be really appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Aug 2023 10:44:44 GMT</pubDate>
    <dc:creator>AshokBabu</dc:creator>
    <dc:date>2023-08-28T10:44:44Z</dc:date>
    <item>
      <title>Help with t XQL BIOC/Correlation  rule</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/help-with-t-xql-bioc-correlation-rule/m-p/555498#M5044</link>
      <description>&lt;P&gt;Hi ALL,&lt;BR /&gt;&lt;BR /&gt;New to XDR world,&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am have a XQL query against a 2FA log which looks for user login (fail or success) from 2 different countries in 3 hours.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Query looks like&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;dataset in (XXX_raw) &lt;BR /&gt;| filter eventType = "User.Login" // look for&amp;nbsp; login events&lt;BR /&gt;| comp min(_time) as Firsttime, max(_time) as Lasttime, count_distinct(country) as location_count, values(state) AS states, values(city) AS cities , values(result) AS results by user_name&lt;BR /&gt;| filter location_count &amp;gt; 1 and timestamp_diff(Lasttime, Firsttime, "HOUR") &amp;lt; 3&lt;BR /&gt;&lt;BR /&gt;Things are fine the "Query Builder" now I want to move it to an alert/rule.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Looks like I can't set&amp;nbsp; BIOC rules bcoz&lt;BR /&gt;&lt;STRONG&gt;"you can create BIOC rules using the&amp;nbsp;&lt;CODE class="computeroutput hljs language-undefined"&gt;xdr_data&lt;/CODE&gt;&amp;nbsp;and&amp;nbsp;&lt;CODE class="computeroutput hljs language-undefined"&gt;cloud_audit_log&lt;/CODE&gt;&amp;nbsp;datasets and presets for these datasets. Currently, you cannot create a BIOC rule on customized datasets and only the&amp;nbsp;&lt;CODE class="computeroutput hljs language-css"&gt;&lt;SPAN class="hljs-attribute"&gt;filter&lt;/SPAN&gt;&lt;/CODE&gt;&amp;nbsp;stage,&amp;nbsp;&lt;CODE class="computeroutput hljs language-sql"&gt;&lt;SPAN class="hljs-keyword"&gt;alter&lt;/SPAN&gt;&lt;/CODE&gt;&amp;nbsp;stage, and functions without any aggregations are supported for XQL queries that define a BIOC" - &lt;A href="https://docs-cortex.paloaltonetworks.com/r/Cortex-XDR/Cortex-XDR-Pro-Administrator-Guide/BIOC-Rule-Details" target="_self"&gt;Ref link&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;So what are my options here? can i create "Correlation rules"?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Plan is to go down the "Correlation rules" path, but as per definition&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Correlation Rules help you analyze correlations of &lt;U&gt;multi-events from multiple sources&lt;/U&gt; by using the&amp;nbsp;&lt;SPAN class="phrase"&gt;Cortex Query Language&lt;/SPAN&gt;&amp;nbsp;(XQL) - &lt;A href="https://docs-cortex.paloaltonetworks.com/r/Cortex-XDR/Cortex-XDR-Pro-Administrator-Guide/Working-with-Correlation-Rules" target="_self"&gt;Ref link&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;does it really need to be "multiple source" (mine is multi event from same source) ?&amp;nbsp;Is there any gottcha I need to consider?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;If any body been on similar situation, any thoughts guidance and help will be really appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 10:44:44 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/help-with-t-xql-bioc-correlation-rule/m-p/555498#M5044</guid>
      <dc:creator>AshokBabu</dc:creator>
      <dc:date>2023-08-28T10:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: Help with t XQL BIOC/Correlation  rule</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/help-with-t-xql-bioc-correlation-rule/m-p/555887#M5060</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/312117"&gt;@AshokBabu&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for reaching out on Live Community!&lt;/P&gt;
&lt;P&gt;Yes, you can create a correlation rule in order to generate alert for your use case. You can use custom dataset/lookup. It need not to be multi source in order for the correlation rule to work.&lt;/P&gt;
&lt;P&gt;Below are some points to remember when writing correlation rule.&lt;/P&gt;
&lt;P&gt;1.&amp;nbsp;&lt;SPAN&gt;The XQL features for&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG class="userinput"&gt;&lt;CODE class="hljs language-undefined"&gt;transaction&lt;/CODE&gt;&lt;/STRONG&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG class="userinput"&gt;&lt;CODE class="hljs language-r"&gt;&lt;SPAN class="hljs-built_in"&gt;call&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/STRONG&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG class="userinput"&gt;&lt;CODE class="hljs language-css"&gt;&lt;SPAN class="hljs-attribute"&gt;top&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/STRONG&gt;&lt;SPAN&gt;, and wildcards in datasets (&lt;/SPAN&gt;&lt;STRONG class="userinput"&gt;&lt;CODE class="hljs language-java"&gt;dataset&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="hljs-title function_"&gt;in&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="hljs-params"&gt;(&amp;lt;dataset prefix&amp;gt;_*)&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/STRONG&gt;&lt;SPAN&gt;) are not currently supported in Correlation Rules. If you add them to the XQL definition, you will not be able to&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="guilabel"&gt;Create&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;or&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="guilabel"&gt;Save&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;the Correlation Rule.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2.&amp;nbsp;Using the current_time() function in your XQL query for a correlation rule can yield unexpected results when there are lags or during downtime. This happens if the correlation rule doesn’t run exactly at the time of the data inside the timeframe, for example when a rule is dependent on another rule, or when a rule is stuck due to an error, and then runs in recovery mode. Instead, we recommend using the time_frame_end() function, which returns the timestamp at the end of the time frame in which the rule is executed.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Aug 2023 17:15:54 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/help-with-t-xql-bioc-correlation-rule/m-p/555887#M5060</guid>
      <dc:creator>nsinghvirk</dc:creator>
      <dc:date>2023-08-30T17:15:54Z</dc:date>
    </item>
  </channel>
</rss>

