<?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 Regex Not Functioning Properly in XQL in Cortex XDR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/regex-not-functioning-properly-in-xql/m-p/581088#M6368</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hello everyone, I'm attempting to extract fields from DHCP logs but encounter an error stating, "Your query failed to run as it's invalid." my regex code works correctly on regex101 and CyberChef. Does anyone have any insights on how to troubleshoot the issue?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;dataset in(infoblox_infoblox_raw )&lt;BR /&gt;|filter _raw_log ~=".*dhcpd.*" &lt;BR /&gt;|alter event_raw = _raw_log &lt;BR /&gt;|alter pid = arrayindex(regextract(_raw_log , "\[(\d+)\]:") ,0) ,&lt;BR /&gt;Infobox_host = arrayindex(regextract(_raw_log , "(?:\s+([^\s]+)\s+)?dhcpd") ,0), &lt;BR /&gt;mac_address = arrayindex(regextract(_raw_log , "DHCPDISCOVER\sfrom\s([A-Fa-f\d]{2}(?:[:-][A-Fa-f\d]{2}){5})") ,0) ,&lt;/P&gt;
&lt;P&gt;hostname1 = arrayindex(regextract(_raw_log , "DHCPDISCOVER\sfrom\s([A-Fa-f\d]{2}(?:[:-][A-Fa-f\d]{2}){5})\(([^)]+)\)") ,0)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;|fields hostname1, mac_address, pid, Infobox_host , _raw_log &lt;BR /&gt;|limit 100&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 20 Mar 2024 17:25:00 GMT</pubDate>
    <dc:creator>AmirSabei</dc:creator>
    <dc:date>2024-03-20T17:25:00Z</dc:date>
    <item>
      <title>Regex Not Functioning Properly in XQL</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/regex-not-functioning-properly-in-xql/m-p/581088#M6368</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello everyone, I'm attempting to extract fields from DHCP logs but encounter an error stating, "Your query failed to run as it's invalid." my regex code works correctly on regex101 and CyberChef. Does anyone have any insights on how to troubleshoot the issue?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;dataset in(infoblox_infoblox_raw )&lt;BR /&gt;|filter _raw_log ~=".*dhcpd.*" &lt;BR /&gt;|alter event_raw = _raw_log &lt;BR /&gt;|alter pid = arrayindex(regextract(_raw_log , "\[(\d+)\]:") ,0) ,&lt;BR /&gt;Infobox_host = arrayindex(regextract(_raw_log , "(?:\s+([^\s]+)\s+)?dhcpd") ,0), &lt;BR /&gt;mac_address = arrayindex(regextract(_raw_log , "DHCPDISCOVER\sfrom\s([A-Fa-f\d]{2}(?:[:-][A-Fa-f\d]{2}){5})") ,0) ,&lt;/P&gt;
&lt;P&gt;hostname1 = arrayindex(regextract(_raw_log , "DHCPDISCOVER\sfrom\s([A-Fa-f\d]{2}(?:[:-][A-Fa-f\d]{2}){5})\(([^)]+)\)") ,0)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;|fields hostname1, mac_address, pid, Infobox_host , _raw_log &lt;BR /&gt;|limit 100&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2024 17:25:00 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/regex-not-functioning-properly-in-xql/m-p/581088#M6368</guid>
      <dc:creator>AmirSabei</dc:creator>
      <dc:date>2024-03-20T17:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: Regex Not Functioning Properly in XQL</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/regex-not-functioning-properly-in-xql/m-p/581154#M6372</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/138677"&gt;@AmirSabei&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Thanks for reaching out on LiveCommunity!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on your query it looks like the issue is with Hostname1 field.&amp;nbsp;&amp;nbsp;&lt;SPAN&gt;The regular expression matches a DHCPDISCOVER message followed by a MAC address and an IP address enclosed in parentheses. Can you confirm exactly what are you looking in hostname1 field?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;if you run without |fields hostname1 it works fine.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Mar 2024 07:18:40 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/regex-not-functioning-properly-in-xql/m-p/581154#M6372</guid>
      <dc:creator>aspatil</dc:creator>
      <dc:date>2024-03-21T07:18:40Z</dc:date>
    </item>
  </channel>
</rss>

