<?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>article How to Add Log Forwarding Profiles in All Security Policies in General Articles</title>
    <link>https://live.paloaltonetworks.com/t5/general-articles/how-to-add-log-forwarding-profiles-in-all-security-policies/ta-p/526763</link>
    <description>&lt;P&gt;This Nominated Discussion Article is based on the post "&lt;A href="https://live.paloaltonetworks.com/t5/general-topics/log-forwarding-profile-in-all-security-policies/td-p/205426" target="_blank" rel="noopener"&gt;Log Forwarding Profile in All Security Policies&lt;/A&gt;" by&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/56772"&gt;@Javith_Ali&lt;/a&gt;&amp;nbsp;and answered by &lt;A href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/43480" target="_blank" rel="noopener"&gt;@BPry&lt;/A&gt;,&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/16592"&gt;@Remo&lt;/a&gt;,&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/15603"&gt;@Raido_Rattameister&lt;/a&gt;,&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/86594"&gt;@SteveKrall&lt;/a&gt; and&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/11943"&gt;@kiwi&lt;/a&gt;. Read on to see the discussion and solution!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV class="lia-message-template-content-zone"&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Is there any other way to configure Log forwarding profile in all 300+ security policies in single shot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Currently there is no log forwarding profile in all 300+ policies.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;First of all I'd like to point out that starting with PAN-OS 10.2 you can add Log Forwarding Profiles in bulk using the policy optimizer:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kiwi_0-1673511148017.png" style="width: 999px;"&gt;&lt;img src="https://live.paloaltonetworks.com/t5/image/serverpage/image-id/46952iAC7649ABC87211FB/image-size/large?v=v2&amp;amp;px=999" role="button" title="kiwi_0-1673511148017.png" alt="kiwi_0-1673511148017.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm sure this is a huge improvement for many users wanting to make these kind of bulk changes and aren't up for scripting or using different tools.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you aren't on PAN-OS 10.2, you can look into the alternatives listed below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can export the XML and modify it manually. This is something you could script, but you would need to collect all of the security policy names to actually write that script.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Other possibilities:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Script that first gets all existing rules and you then set the log forwarding profile with a foreach-loop in all existing rules&lt;/LI&gt;
&lt;LI&gt;Issue the cli command "set cli config-output-format set", go into config mode, show the security rulebase and include match statement like source zone. This will show you a list with your rules which you can copy to a text editor to replace all source zone parts with "log-setting LOGFORWADRINGPROFILENAME". And finally paste all these commands into the cli and commit&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your case you need to get list of rules like mentioned above and go from there:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://live.paloaltonetworks.com/t5/General-Topics/Changing-Profiles-assigned-to-security-Rule/m-p/79284/highlight/true#M43228" target="_self"&gt;Changing Profiles Assigned to Security Rule&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another option would be to dump config in "set format" to see the actual CLI command.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest adding the log forward option to at least 1 policy so you have a reference cli command. Then you can save this as a CSV file. Then sort the relevant data and delete everything else. Then add the missing syntax. Then convert the csv back to text and paste as CLI.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively you can use Expedition, formerly known as the Migration Tool. This is one of the best things about the tool - batch rule changes (Setting Security Profiles on all rules, Log Forwarding, etc).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Connect the FW (or Panorama) to the Migration Tool, ingest policies, multi-rule edit, then API push the rules back to Firewall &amp;gt; Validate policies &amp;gt; Commit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another option is the pan-configuration tool which will also allow you to make bulk changes:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/cpainchaud/pan-configurator" target="_blank" rel="noopener"&gt;https://github.com/cpainchaud/pan-configurator&lt;/A&gt; or the newer version &lt;A href="https://github.com/PaloAltoNetworks/pan-os-php" target="_blank" rel="noopener"&gt;https://github.com/PaloAltoNetworks/pan-os-php&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use the rules-edit.php function to update all your rules with the new log profile.&lt;/P&gt;
&lt;/DIV&gt;
&lt;DIV id="ConnectiveDocSignExtentionInstalled" data-extension-version="1.0.4"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
    <pubDate>Thu, 12 Jan 2023 15:15:55 GMT</pubDate>
    <dc:creator>kiwi</dc:creator>
    <dc:date>2023-01-12T15:15:55Z</dc:date>
    <item>
      <title>How to Add Log Forwarding Profiles in All Security Policies</title>
      <link>https://live.paloaltonetworks.com/t5/general-articles/how-to-add-log-forwarding-profiles-in-all-security-policies/ta-p/526763</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV id="ConnectiveDocSignExtentionInstalled" data-extension-version="1.0.4"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Thu, 12 Jan 2023 15:15:55 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-articles/how-to-add-log-forwarding-profiles-in-all-security-policies/ta-p/526763</guid>
      <dc:creator>kiwi</dc:creator>
      <dc:date>2023-01-12T15:15:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to Add Log Forwarding Profiles in All Security Policies</title>
      <link>https://live.paloaltonetworks.com/t5/general-articles/how-to-add-log-forwarding-profiles-in-all-security-policies/tac-p/535454#M601</link>
      <description>&lt;P&gt;One more great automation article and I love automating security &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2023 15:55:25 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-articles/how-to-add-log-forwarding-profiles-in-all-security-policies/tac-p/535454#M601</guid>
      <dc:creator>nikoolayy1</dc:creator>
      <dc:date>2023-03-22T15:55:25Z</dc:date>
    </item>
  </channel>
</rss>

