<?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: Get info from different dataset and compare in Cortex XDR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/get-info-from-different-dataset-and-compare/m-p/534505#M3843</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/271703"&gt;@FabioFerreira&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are on the right track using the &lt;CODE&gt;json_extract&lt;/CODE&gt; function, perhaps there was a syntax error. Here is an example building upon the previous query showing how to extract the &lt;CODE&gt;TargetUserName&lt;/CODE&gt; property from the JSON object and create a new column with that value using the &lt;CODE&gt;alter&lt;/CODE&gt; stage:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;preset = xdr_event_log 
| filter action_evtlog_event_id = 4625
| filter agent_hostname in (dataset = endpoints 
| filter tags contains "CRITICAL"
| fields endpoint_name)
| alter TargetUserName = json_extract(action_evtlog_data_fields, "$.TargetUserName")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The &lt;CODE&gt;TargetUserName&lt;/CODE&gt; property displays the username value wrapped in quotation marks, so if you wanted to take this a step further and remove those, you could use the &lt;CODE&gt;trim&lt;/CODE&gt; function, using the entire &lt;CODE&gt;json_extract&lt;/CODE&gt; function as an input like this:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| alter TargetUserName = trim(json_extract(action_evtlog_data_fields, "$.TargetUserName"), "\"")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This will remove the quotation marks and give you a new column with just the username value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Tim&lt;/P&gt;</description>
    <pubDate>Wed, 15 Mar 2023 17:03:46 GMT</pubDate>
    <dc:creator>timurphy</dc:creator>
    <dc:date>2023-03-15T17:03:46Z</dc:date>
    <item>
      <title>Get info from different dataset and compare</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/get-info-from-different-dataset-and-compare/m-p/534449#M3838</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need to get failed logins from critical assets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I was trying to get tag "CRITICAL" in endpoints dataset and if there are any "event_type = ENUM.EVENT_LOG and action_evtlog_event_id = 4625 in xdr_data dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you help pls&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2023 12:48:52 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/get-info-from-different-dataset-and-compare/m-p/534449#M3838</guid>
      <dc:creator>FabioFerreira</dc:creator>
      <dc:date>2023-03-15T12:48:52Z</dc:date>
    </item>
    <item>
      <title>Re: Get info from different dataset and compare</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/get-info-from-different-dataset-and-compare/m-p/534459#M3840</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/271703"&gt;@FabioFerreira&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This can be accomplished by using a nested query (wrapped in parenthesis) in a &lt;CODE&gt;filter&lt;/CODE&gt; stage. Here is an example of such a query to help you get started:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;preset = xdr_event_log 
| filter action_evtlog_event_id = 4625
| filter agent_hostname in (dataset = endpoints 
| filter tags contains "CRITICAL"
| fields endpoint_name)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;I hope this helps!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Tim&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2023 14:28:10 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/get-info-from-different-dataset-and-compare/m-p/534459#M3840</guid>
      <dc:creator>timurphy</dc:creator>
      <dc:date>2023-03-15T14:28:10Z</dc:date>
    </item>
    <item>
      <title>Re: Get info from different dataset and compare</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/get-info-from-different-dataset-and-compare/m-p/534486#M3842</link>
      <description>&lt;P&gt;Thank you Tim!&lt;/P&gt;
&lt;P&gt;That helped me a lot, now I need to extract TargetUserName from column "action_evtlog_data_fields ", that it is in json format.&lt;/P&gt;
&lt;P&gt;I was trying to use json_extract without success.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Fabio&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2023 16:22:14 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/get-info-from-different-dataset-and-compare/m-p/534486#M3842</guid>
      <dc:creator>FabioFerreira</dc:creator>
      <dc:date>2023-03-15T16:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: Get info from different dataset and compare</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/get-info-from-different-dataset-and-compare/m-p/534505#M3843</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/271703"&gt;@FabioFerreira&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are on the right track using the &lt;CODE&gt;json_extract&lt;/CODE&gt; function, perhaps there was a syntax error. Here is an example building upon the previous query showing how to extract the &lt;CODE&gt;TargetUserName&lt;/CODE&gt; property from the JSON object and create a new column with that value using the &lt;CODE&gt;alter&lt;/CODE&gt; stage:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;preset = xdr_event_log 
| filter action_evtlog_event_id = 4625
| filter agent_hostname in (dataset = endpoints 
| filter tags contains "CRITICAL"
| fields endpoint_name)
| alter TargetUserName = json_extract(action_evtlog_data_fields, "$.TargetUserName")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The &lt;CODE&gt;TargetUserName&lt;/CODE&gt; property displays the username value wrapped in quotation marks, so if you wanted to take this a step further and remove those, you could use the &lt;CODE&gt;trim&lt;/CODE&gt; function, using the entire &lt;CODE&gt;json_extract&lt;/CODE&gt; function as an input like this:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| alter TargetUserName = trim(json_extract(action_evtlog_data_fields, "$.TargetUserName"), "\"")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This will remove the quotation marks and give you a new column with just the username value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Tim&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2023 17:03:46 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/get-info-from-different-dataset-and-compare/m-p/534505#M3843</guid>
      <dc:creator>timurphy</dc:creator>
      <dc:date>2023-03-15T17:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: Get info from different dataset and compare</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/get-info-from-different-dataset-and-compare/m-p/534510#M3845</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/231174"&gt;@timurphy&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks, that was perfect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I was trying&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| alter action_evtlog_data_fields = json_extract(action_evtlog_data_fields, "TargetUserName")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But your answer solved my problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| alter TargetUserName = trim(json_extract(action_evtlog_data_fields, "$.TargetUserName"), "\"")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Fabio&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2023 17:18:17 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xdr-discussions/get-info-from-different-dataset-and-compare/m-p/534510#M3845</guid>
      <dc:creator>FabioFerreira</dc:creator>
      <dc:date>2023-03-15T17:18:17Z</dc:date>
    </item>
  </channel>
</rss>

