<?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: XQL  Query Help in Cortex XDR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-help/m-p/599856#M7292</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/1233674317"&gt;@Y.Kiroglu&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks for reaching out on LiveCommunity!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Below query will help with more information:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;preset = xdr_event_log&lt;BR /&gt;// Parse the user that is provisioning the account&lt;BR /&gt;| alter provisioning_sid = arrayindex(regextract(action_evtlog_message ,"Security ID:\t+(.*)\r\n"),0)&lt;BR /&gt;| alter provisioning_account_name = arrayindex(regextract(action_evtlog_message ,"Account Name:\t+(.*)\r\n"),0)&lt;BR /&gt;| alter provisioning_account_domain = arrayindex(regextract(action_evtlog_message ,"Account Domain:\t+(.*)\r\n"),0)&lt;BR /&gt;// Parse the new users account info&lt;BR /&gt;| alter new_sid = arrayindex(regextract(action_evtlog_message ,"Security ID:\t+(.*)\r\n"),1)&lt;BR /&gt;| alter account_name = arrayindex(regextract(action_evtlog_message ,"New Account:(?:[^\n]*\n){2}(?:[^\n]Account Name:\t+(.*))"),0)&lt;BR /&gt;// Parse the group attributes&lt;BR /&gt;| alter group_sid = arrayindex(regextract(action_evtlog_message ,"Security ID:\t+(.*)\r\n"),2)&lt;BR /&gt;| alter group_name = arrayindex(regextract(action_evtlog_message ,"Group Name:\t+(.*)\r\n"),0)&lt;BR /&gt;| alter group_domain = arrayindex(regextract(action_evtlog_message ,"Group Domain:\t+(.*)\r\n"),0)&lt;BR /&gt;// Get all events and dedup&lt;BR /&gt;| filter action_evtlog_event_id = 4720 OR action_evtlog_event_id = 4732 or action_evtlog_event_id = 4726 or action_evtlog_event_id = 4730&lt;BR /&gt;| dedup agent_hostname, action_evtlog_event_id, group_name, new_sid&lt;BR /&gt;// remove all machine accounts being created&lt;BR /&gt;| filter account_name not contains "$"&lt;BR /&gt;// make everything look pretty grouped on host&lt;BR /&gt;| fields _time, agent_hostname, agent_ip_addresses, action_evtlog_description, action_evtlog_event_id, action_evtlog_message, provisioning_sid, provisioning_account_name, provisioning_account_domain, new_sid, account_name, group_sid, group_name, group_domain&lt;BR /&gt;| transaction _time, agent_hostname, agent_ip_addresses, action_evtlog_description, action_evtlog_event_id, action_evtlog_message, provisioning_sid, provisioning_account_name, provisioning_account_domain, new_sid, account_name, group_sid, group_name, group_domain span=180m&lt;BR /&gt;| comp values(action_evtlog_event_id) as EventID, values(provisioning_sid) as provisioning_sid, values(provisioning_account_name) as provisioning_account_name, values(provisioning_account_domain) as provisioning_account_domain, values(new_sid) as new_sid, values(account_name) as new_account_name, values(group_sid) as group_sid, values(group_name) as group_name, values(group_domain) as group_domain, count() as logs_per_host_provisioned by agent_hostname&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you feel this has answered your query, please let us know by clicking on "mark this as a Solution". Thank you.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Ashutosh&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Oct 2024 06:59:16 GMT</pubDate>
    <dc:creator>aspatil</dc:creator>
    <dc:date>2024-10-09T06:59:16Z</dc:date>
    <item>
      <title>XQL  Query Help</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-help/m-p/599845#M7291</link>
      <description>&lt;P&gt;I am trying to create a rule for the case of creating a new user in the admin role.&amp;nbsp;Where's my mistake? &lt;BR /&gt;I am grateful for your help.&lt;BR /&gt;&lt;BR /&gt;dataset = xdr_data&amp;nbsp;&lt;BR /&gt;| filter action_evtlog_event_id = 4720&lt;/P&gt;
&lt;P&gt;| alter Direct_Role = arrayindex(regextract(action_evtlog_message, "Account Type:.*?(\w.*?)\r\n"),0)&lt;BR /&gt;| filter Direct_Role contains "Admin" or Direct_Role contains "Administrator"&amp;nbsp;&lt;BR /&gt;| fields _time, Direct_Role, action_evtlog_message as Raw_Message&amp;nbsp;&lt;BR /&gt;| sort desc _time&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2024 05:55:29 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-help/m-p/599845#M7291</guid>
      <dc:creator>Y.Kiroglu</dc:creator>
      <dc:date>2024-10-09T05:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: XQL  Query Help</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-help/m-p/599856#M7292</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/1233674317"&gt;@Y.Kiroglu&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks for reaching out on LiveCommunity!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Below query will help with more information:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;preset = xdr_event_log&lt;BR /&gt;// Parse the user that is provisioning the account&lt;BR /&gt;| alter provisioning_sid = arrayindex(regextract(action_evtlog_message ,"Security ID:\t+(.*)\r\n"),0)&lt;BR /&gt;| alter provisioning_account_name = arrayindex(regextract(action_evtlog_message ,"Account Name:\t+(.*)\r\n"),0)&lt;BR /&gt;| alter provisioning_account_domain = arrayindex(regextract(action_evtlog_message ,"Account Domain:\t+(.*)\r\n"),0)&lt;BR /&gt;// Parse the new users account info&lt;BR /&gt;| alter new_sid = arrayindex(regextract(action_evtlog_message ,"Security ID:\t+(.*)\r\n"),1)&lt;BR /&gt;| alter account_name = arrayindex(regextract(action_evtlog_message ,"New Account:(?:[^\n]*\n){2}(?:[^\n]Account Name:\t+(.*))"),0)&lt;BR /&gt;// Parse the group attributes&lt;BR /&gt;| alter group_sid = arrayindex(regextract(action_evtlog_message ,"Security ID:\t+(.*)\r\n"),2)&lt;BR /&gt;| alter group_name = arrayindex(regextract(action_evtlog_message ,"Group Name:\t+(.*)\r\n"),0)&lt;BR /&gt;| alter group_domain = arrayindex(regextract(action_evtlog_message ,"Group Domain:\t+(.*)\r\n"),0)&lt;BR /&gt;// Get all events and dedup&lt;BR /&gt;| filter action_evtlog_event_id = 4720 OR action_evtlog_event_id = 4732 or action_evtlog_event_id = 4726 or action_evtlog_event_id = 4730&lt;BR /&gt;| dedup agent_hostname, action_evtlog_event_id, group_name, new_sid&lt;BR /&gt;// remove all machine accounts being created&lt;BR /&gt;| filter account_name not contains "$"&lt;BR /&gt;// make everything look pretty grouped on host&lt;BR /&gt;| fields _time, agent_hostname, agent_ip_addresses, action_evtlog_description, action_evtlog_event_id, action_evtlog_message, provisioning_sid, provisioning_account_name, provisioning_account_domain, new_sid, account_name, group_sid, group_name, group_domain&lt;BR /&gt;| transaction _time, agent_hostname, agent_ip_addresses, action_evtlog_description, action_evtlog_event_id, action_evtlog_message, provisioning_sid, provisioning_account_name, provisioning_account_domain, new_sid, account_name, group_sid, group_name, group_domain span=180m&lt;BR /&gt;| comp values(action_evtlog_event_id) as EventID, values(provisioning_sid) as provisioning_sid, values(provisioning_account_name) as provisioning_account_name, values(provisioning_account_domain) as provisioning_account_domain, values(new_sid) as new_sid, values(account_name) as new_account_name, values(group_sid) as group_sid, values(group_name) as group_name, values(group_domain) as group_domain, count() as logs_per_host_provisioned by agent_hostname&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you feel this has answered your query, please let us know by clicking on "mark this as a Solution". Thank you.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Ashutosh&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2024 06:59:16 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/xql-query-help/m-p/599856#M7292</guid>
      <dc:creator>aspatil</dc:creator>
      <dc:date>2024-10-09T06:59:16Z</dc:date>
    </item>
  </channel>
</rss>

