<?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 Script for pulling disabled rule in set format in Next-Generation Firewall Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/next-generation-firewall/script-for-pulling-disabled-rule-in-set-format/m-p/1235531#M6171</link>
    <description>&lt;P&gt;Hi Team&amp;nbsp;&lt;BR /&gt;I am trying to pull the details of disabled rule in set format. I am using pan-sdk .&lt;BR /&gt;I can pull the complete list but not able to retrieve only rule which are disabled.&lt;BR /&gt;And is to possible to pull rule in "set" format or need to use XML API ?&lt;BR /&gt;&lt;BR /&gt;Any pointer will help here.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Deepak&lt;/P&gt;</description>
    <pubDate>Wed, 06 Aug 2025 14:24:10 GMT</pubDate>
    <dc:creator>D.Verma502651</dc:creator>
    <dc:date>2025-08-06T14:24:10Z</dc:date>
    <item>
      <title>Script for pulling disabled rule in set format</title>
      <link>https://live.paloaltonetworks.com/t5/next-generation-firewall/script-for-pulling-disabled-rule-in-set-format/m-p/1235531#M6171</link>
      <description>&lt;P&gt;Hi Team&amp;nbsp;&lt;BR /&gt;I am trying to pull the details of disabled rule in set format. I am using pan-sdk .&lt;BR /&gt;I can pull the complete list but not able to retrieve only rule which are disabled.&lt;BR /&gt;And is to possible to pull rule in "set" format or need to use XML API ?&lt;BR /&gt;&lt;BR /&gt;Any pointer will help here.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Deepak&lt;/P&gt;</description>
      <pubDate>Wed, 06 Aug 2025 14:24:10 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/next-generation-firewall/script-for-pulling-disabled-rule-in-set-format/m-p/1235531#M6171</guid>
      <dc:creator>D.Verma502651</dc:creator>
      <dc:date>2025-08-06T14:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: Script for pulling disabled rule in set format</title>
      <link>https://live.paloaltonetworks.com/t5/next-generation-firewall/script-for-pulling-disabled-rule-in-set-format/m-p/1236273#M6223</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://live.paloaltonetworks.com/t5/user/viewprofilepage/user-id/1466448807"&gt;@D.Verma502651&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is one "quick and dirty" way to achieve what you want, without any scripting or API.&lt;/P&gt;
&lt;P&gt;Little fun facts first:&lt;BR /&gt;- PanOS is utilizing the "less" pager when showing any file (being log or config file)&lt;/P&gt;
&lt;P&gt;- less has a build-in feature that allow you to show only the lines of the file which match a given pattern -&amp;nbsp;&lt;A href="https://man7.org/linux/man-pages/man1/less.1.html" target="_blank"&gt;https://man7.org/linux/man-pages/man1/less.1.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;PRE&gt;  &amp;amp;pattern
              Display o&lt;STRONG&gt;nly lines which match the pattern&lt;/STRONG&gt;; lines which do
              not match the pattern are not displayed.  If pattern is
              empty (if you type &amp;amp; immediately followed by ENTER), any
              filtering is turned off, and all lines are displayed.
              While filtering is in effect, an ampersand is displayed at
              the beginning of the prompt, as a reminder that some lines
              in the file may be hidden.  Multiple &amp;amp; commands may be
              entered, in which case only lines which match all of the
              patterns will be displayed.&lt;/PRE&gt;
&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In a nutshell you have "grep" capabilities for the config file right in the firewall.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Armed with this information you could:&lt;/P&gt;
&lt;P&gt;1. Login to Firewall/Panorama CLI&lt;/P&gt;
&lt;P&gt;2. Set the config output to set&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;user@My-PAN-FW&amp;gt; set cli config-output-format set&lt;/LI-CODE&gt;
&lt;P&gt;3. Enter configure mode and climb the configuration&amp;nbsp;hierarchy&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;# For Panorama
[edit]
user@My-Panorama# edit device-group My-PAN-FW pre-rulebase security
[edit device-group My-PAN-FW pre-rulebase security]
user@MY-Panorama# show


# For Firewall
[edit]
user@My-PAN-FW# edit rulebase security
[edit rulebase security]
user@My-PAN-FW# show&lt;/LI-CODE&gt;
&lt;P&gt;4. As your firewall policy is longer than your terminal the output will be presented by the "less". While inside "less" you enter the "&amp;amp;" followed by the pattern you search. In your case you look for all rules that are disabled&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&amp;amp;disabled\ yes&lt;/LI-CODE&gt;
&lt;P&gt;Above will return all lines where the "disabled yes" is found. Since the output is in set format the name of the firewall rule will be in the same line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Aug 2025 22:13:16 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/next-generation-firewall/script-for-pulling-disabled-rule-in-set-format/m-p/1236273#M6223</guid>
      <dc:creator>aleksandar.astardzhiev</dc:creator>
      <dc:date>2025-08-19T22:13:16Z</dc:date>
    </item>
  </channel>
</rss>

