<?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: Rule base export with zero hit count in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Rule-base-export-with-zero-hit-count/m-p/31281#M1888</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; You may try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mgmt_cli show access-rulebase offset 0 limit 20 name "Network" details-level "standard" use-object-dictionary true show-hits true hits-settings.from-date "2019-01-01" hits-settings.to-date "2019-01-30" hits-settings.target "XXX"&amp;nbsp; --format json -u XXX -p XXX |jq -r '.rulebase[].rulebase[]|select(.hits.value == 0)| [."rule-number", ."name", ."comments", ."enabled" ]|@csv' &amp;gt; Unusedrules.csv&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;Kannan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 10 Feb 2019 04:39:03 GMT</pubDate>
    <dc:creator>Kannan_R</dc:creator>
    <dc:date>2019-02-10T04:39:03Z</dc:date>
    <item>
      <title>Rule base export with zero hit count</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Rule-base-export-with-zero-hit-count/m-p/31279#M1886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to export the rules with zero hit count for past three months using&amp;nbsp;API to do a rule base clean up.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to filter only the rules with zero counts to be exported using show access-rulebase command&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My commnad as follows&amp;nbsp;&lt;/P&gt;&lt;P&gt;mgmt_cli show access-rulebase offset 0 limit 20 name "Network" details-level "standard" use-object-dictionary true show-hits true hits-settings.from-date "2019-01-01" hits-settings.to-date "2019-01-30" hits-settings.target "XXX"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Feb 2019 08:42:26 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Rule-base-export-with-zero-hit-count/m-p/31279#M1886</guid>
      <dc:creator>Arun66</dc:creator>
      <dc:date>2019-02-07T08:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: Rule base export with zero hit count</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Rule-base-export-with-zero-hit-count/m-p/31280#M1887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The API team has actually recently released a script to accomplish something very similar. It might work directly for you or maybe you can draw inspiration from it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://github.com/CheckPointSW/PolicyCleanUp" title="https://github.com/CheckPointSW/PolicyCleanUp"&gt;GitHub - CheckPointSW/PolicyCleanUp&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2019 12:59:50 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Rule-base-export-with-zero-hit-count/m-p/31280#M1887</guid>
      <dc:creator>Joshua_Hatter</dc:creator>
      <dc:date>2019-02-08T12:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Rule base export with zero hit count</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Rule-base-export-with-zero-hit-count/m-p/31281#M1888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; You may try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mgmt_cli show access-rulebase offset 0 limit 20 name "Network" details-level "standard" use-object-dictionary true show-hits true hits-settings.from-date "2019-01-01" hits-settings.to-date "2019-01-30" hits-settings.target "XXX"&amp;nbsp; --format json -u XXX -p XXX |jq -r '.rulebase[].rulebase[]|select(.hits.value == 0)| [."rule-number", ."name", ."comments", ."enabled" ]|@csv' &amp;gt; Unusedrules.csv&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;Kannan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Feb 2019 04:39:03 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Rule-base-export-with-zero-hit-count/m-p/31281#M1888</guid>
      <dc:creator>Kannan_R</dc:creator>
      <dc:date>2019-02-10T04:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: Rule base export with zero hit count</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Rule-base-export-with-zero-hit-count/m-p/66518#M4072</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;i am new to this so wanted your help&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;what does XXX mean? where should i mention the server name?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;can you please guide me&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;&lt;P&gt;&lt;SPAN&gt;Sudhir Mirajkar&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Nov 2019 15:41:51 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Rule-base-export-with-zero-hit-count/m-p/66518#M4072</guid>
      <dc:creator>sudhir_mirajkar</dc:creator>
      <dc:date>2019-11-04T15:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: Rule base export with zero hit count</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Rule-base-export-with-zero-hit-count/m-p/80897#M4676</link>
      <description>&lt;P&gt;mgmt_cli show access-rulebase offset 0 limit 20 name "Network" details-level "standard" use-object-dictionary true show-hits true hits-settings.from-date "2019-01-01" hits-settings.to-date "2019-01-30" hits-settings.target "XXX" --format json -u XXX -p XXX |jq -r '.rulebase[].rulebase[]|select(.hits.value == 0)| [."rule-number", ."name", ."comments", ."enabled" ]|@csv' &amp;gt; Unusedrules.csv&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi I have tried this I am able to get the output for "mgmt_cli show access-rulebase offset 0 limit 20 name "Network" details-level "standard" use-object-dictionary true show-hits true hits-settings.from-date "2019-01-01" hits-settings.to-date "2019-01-30" hits-settings.target "XXX" --format json -u XXX -p XXX "&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but after enter to jq I am unable to get the output&lt;/P&gt;&lt;P&gt;I am getting the below output&lt;/P&gt;&lt;P&gt;" mgmt show access-rulebase name "xxxx" details-level "xxxx" show-hits true hits-settings.from-date "2020-01-01" hits-settings.to-date "2020-04-03" hits-settings.target "xxxx" --format json -u ."json" -p ."json"|jq -r '.rulebase[].rulebase[]|select(.hits.value == 0)| [."rule-number", ."name", ."comments", ."enabled" ]|@csv'&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;MGMT9000 Invalid value [.rulebase[].rulebase[]|select(.hits.value == 0)| [."rule-number", ."name", ."comments", ."enabled" ]|@csv] of parameter [ $▒▒▒X▒▒▒x▒- x▒- y▒- x▒- ▒- x▒- ▒▒▒, $▒▒▒X▒▒▒x▒- x▒- y▒- x▒- (▒- x▒- ▒▒▒]&lt;BR /&gt;Checkpoint&amp;gt;"&lt;/P&gt;&lt;P&gt;Can some one help me to get rid of this problem&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Venu.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2020 06:28:30 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Rule-base-export-with-zero-hit-count/m-p/80897#M4676</guid>
      <dc:creator>venudevannagari</dc:creator>
      <dc:date>2020-04-06T06:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: Rule base export with zero hit count</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Rule-base-export-with-zero-hit-count/m-p/82170#M4738</link>
      <description>&lt;P&gt;Hi Joshua&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That looks to be an awesome tool and could save us a lot of time &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &amp;nbsp; One bit of enhancement that I think would be great is to include an option where you can exclude rules that were created or modified within X period of time as well.&amp;nbsp; That would save not taking action on a lot of recently added rules.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 22:26:45 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Rule-base-export-with-zero-hit-count/m-p/82170#M4738</guid>
      <dc:creator>cem82</dc:creator>
      <dc:date>2020-04-16T22:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: Rule base export with zero hit count</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Rule-base-export-with-zero-hit-count/m-p/82334#M4740</link>
      <description>Hi Sudhir, All the information you seek can be found in the Management API Reference Guide &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;</description>
      <pubDate>Sat, 18 Apr 2020 21:16:03 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Rule-base-export-with-zero-hit-count/m-p/82334#M4740</guid>
      <dc:creator>James_ONeill1</dc:creator>
      <dc:date>2020-04-18T21:16:03Z</dc:date>
    </item>
    <item>
      <title>Re: Rule base export with zero hit count</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Rule-base-export-with-zero-hit-count/m-p/83186#M4778</link>
      <description>Hi Joshua,&lt;BR /&gt;&lt;BR /&gt;I just downloaded the package , but seems the script can not run in SMC , it requires dependancy to install pip , setuptools and so on.&lt;BR /&gt;&lt;BR /&gt;May I know how we move forward this ?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 26 Apr 2020 06:54:53 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Rule-base-export-with-zero-hit-count/m-p/83186#M4778</guid>
      <dc:creator>Hugo_Zhao</dc:creator>
      <dc:date>2020-04-26T06:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: Rule base export with zero hit count</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Rule-base-export-with-zero-hit-count/m-p/98569#M5212</link>
      <description>&lt;P&gt;Is this still the case?&amp;nbsp; Do we need to install pip, setuptools, etc?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2020 15:37:21 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Rule-base-export-with-zero-hit-count/m-p/98569#M5212</guid>
      <dc:creator>Casey_Mullarkey</dc:creator>
      <dc:date>2020-10-08T15:37:21Z</dc:date>
    </item>
  </channel>
</rss>

