<?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: XSOAR Playbook SQL Query in Cortex XSOAR Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/xsoar-playbook-sql-query/m-p/579325#M3123</link>
    <description>&lt;P&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;Thank you for your response, unfortunately it is not clear to me how to specify in my case the field I need in Extend-context.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;Might you help me?&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;If I need to obtain the "record_number" column, what should I place?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Mar 2024 17:13:15 GMT</pubDate>
    <dc:creator>gerardo.rodriguez</dc:creator>
    <dc:date>2024-03-05T17:13:15Z</dc:date>
    <item>
      <title>XSOAR Playbook SQL Query</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/xsoar-playbook-sql-query/m-p/578755#M3110</link>
      <description>&lt;P&gt;hello everyone !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm new to XSOAR, I hope you'll be patient with me. I have created a small job in which I execute a SELECT type SQL query, the result is a series of records. Here I have some doubts:&lt;BR /&gt;- How can I map the result of each record in each field of type "Output"? My goal is to add a new task which executes some conditionals based on the records obtained with the previous query.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In addition to this, I tell you that I have two instances of SQL SERVER (Connections with 2 databases), after executing the SQL SELECT query I cannot identify which database the query is being executed in. Where do I configure so that the SQL query is executed on instance1 or instance2?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My goal is for the final result of the SQL query to be sent to certain emails as a report. I plan to execute this playbook within a job.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Greetings&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 04:29:59 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/xsoar-playbook-sql-query/m-p/578755#M3110</guid>
      <dc:creator>GSecurity</dc:creator>
      <dc:date>2024-02-29T04:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: XSOAR Playbook SQL Query</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/xsoar-playbook-sql-query/m-p/578833#M3112</link>
      <description>&lt;P&gt;Hi !&lt;BR /&gt;&lt;BR /&gt;What do you mean by Output" in "in each field of type "Output""? An entry in the War Room or the Output settings of an automation ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 12:45:56 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/xsoar-playbook-sql-query/m-p/578833#M3112</guid>
      <dc:creator>madani</dc:creator>
      <dc:date>2024-02-29T12:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: XSOAR Playbook SQL Query</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/xsoar-playbook-sql-query/m-p/579187#M3117</link>
      <description>&lt;P&gt;&lt;SPAN&gt;hi,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I mean how can I do something similar as I show in the image, basically what I need is to be able to make a conditional to search for a record of the SQL query executed in the query&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Mar 2024 20:27:45 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/xsoar-playbook-sql-query/m-p/579187#M3117</guid>
      <dc:creator>gerardo.rodriguez</dc:creator>
      <dc:date>2024-03-04T20:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: XSOAR Playbook SQL Query</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/xsoar-playbook-sql-query/m-p/579299#M3119</link>
      <description>&lt;P&gt;To custom the mapping of an automation result you can use the argument "extend-context".&lt;BR /&gt;In a playbook task you can find this argument under the "Advanced" tab.&lt;BR /&gt;For exemple if you using this automation (&lt;A href="https://xsoar.pan.dev/docs/reference/integrations/generic-sql#2-sql-command" target="_blank"&gt;https://xsoar.pan.dev/docs/reference/integrations/generic-sql#2-sql-command&lt;/A&gt;), you can save the Result key under a new context key with : -extend-context:"NewContextKey=Result"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;# Documentation for extend-context&lt;BR /&gt;&lt;A href="https://xsoar.pan.dev/docs/playbooks/playbooks-extend-context" target="_blank"&gt;https://xsoar.pan.dev/docs/playbooks/playbooks-extend-context&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;If you want to make a more advanced mapping, i advise you to make your own script wrapping your SQL command, format the result, and push it to the context with CommandResults()&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;# Documentation for CommandResults&lt;BR /&gt;&lt;A href="https://xsoar.pan.dev/docs/integrations/context-and-outputs" target="_blank"&gt;https://xsoar.pan.dev/docs/integrations/context-and-outputs&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;For the selection of the instance, you can use the argument "using", also present under the "Advanced" tab in the playbook task panel, where you can precise a name instance. It will also prevent the multi-instance execution&lt;/P&gt;
&lt;P&gt;PS : I can't see the image you have mentionned.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2024 13:20:47 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/xsoar-playbook-sql-query/m-p/579299#M3119</guid>
      <dc:creator>madani</dc:creator>
      <dc:date>2024-03-05T13:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: XSOAR Playbook SQL Query</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/xsoar-playbook-sql-query/m-p/579325#M3123</link>
      <description>&lt;P&gt;&lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;Thank you for your response, unfortunately it is not clear to me how to specify in my case the field I need in Extend-context.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;Might you help me?&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="jCAhz ChMk0b"&gt;&lt;SPAN class="ryNqvb"&gt;If I need to obtain the "record_number" column, what should I place?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2024 17:13:15 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/xsoar-playbook-sql-query/m-p/579325#M3123</guid>
      <dc:creator>gerardo.rodriguez</dc:creator>
      <dc:date>2024-03-05T17:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: XSOAR Playbook SQL Query</title>
      <link>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/xsoar-playbook-sql-query/m-p/579451#M3126</link>
      <description>&lt;P&gt;To have the list of the record_number youcan use -extend-context="SQLResult=GenericSQL.GenericSQL.Result.record_number"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After that if you give this list as argument in a an automation, the automation is going to process the list elements (the record_numbers) one by one, same for a conditionnal task.&lt;/P&gt;
&lt;P&gt;According to what you want to do with, you maybe need a subplaybook to iterate on each record_number. But keep in mind you can use a filter on the argument instead of a condtionnal task&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2024 11:45:58 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/cortex-xsoar-discussions/xsoar-playbook-sql-query/m-p/579451#M3126</guid>
      <dc:creator>madani</dc:creator>
      <dc:date>2024-03-06T11:45:58Z</dc:date>
    </item>
  </channel>
</rss>

