<?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 Hit count  R80.10 in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Hit-count-R80-10/m-p/81723#M4726</link>
    <description>&lt;P&gt;Good day guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have a question is about hit count. Customer told us that if is possible to extract hit count of their policies. We execute some SK's but is not shown. Then I did try with api commands but my tests have not succesfully&lt;/P&gt;&lt;P&gt;Currently we try to execute this command but is not working.&lt;/P&gt;&lt;P&gt;mgmt_cli show access-rulebase offset 0 limit 20 name "Network" details-level "standard" show-hits true hits-settings.target "XXX" --root true --format json | $CPDIR/jq/jq '.rulebase[] | select(.hits.value == 0) | [.rule-number , .name , .comments , .enabled ] | @csv' -r &amp;gt; hits.csv&lt;/P&gt;&lt;P&gt;And when I did execute shown this error&lt;BR /&gt;error: number is not defined&lt;BR /&gt;.rulebase[] | select(.hits.value == 0) | [.rule-number , .name , .comments , .enabled ] | @csv 1 compile error&lt;/P&gt;&lt;P&gt;Could you help me with this?&lt;/P&gt;</description>
    <pubDate>Mon, 13 Apr 2020 21:59:38 GMT</pubDate>
    <dc:creator>Carlos_Arzate</dc:creator>
    <dc:date>2020-04-13T21:59:38Z</dc:date>
    <item>
      <title>Hit count  R80.10</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Hit-count-R80-10/m-p/81723#M4726</link>
      <description>&lt;P&gt;Good day guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have a question is about hit count. Customer told us that if is possible to extract hit count of their policies. We execute some SK's but is not shown. Then I did try with api commands but my tests have not succesfully&lt;/P&gt;&lt;P&gt;Currently we try to execute this command but is not working.&lt;/P&gt;&lt;P&gt;mgmt_cli show access-rulebase offset 0 limit 20 name "Network" details-level "standard" show-hits true hits-settings.target "XXX" --root true --format json | $CPDIR/jq/jq '.rulebase[] | select(.hits.value == 0) | [.rule-number , .name , .comments , .enabled ] | @csv' -r &amp;gt; hits.csv&lt;/P&gt;&lt;P&gt;And when I did execute shown this error&lt;BR /&gt;error: number is not defined&lt;BR /&gt;.rulebase[] | select(.hits.value == 0) | [.rule-number , .name , .comments , .enabled ] | @csv 1 compile error&lt;/P&gt;&lt;P&gt;Could you help me with this?&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2020 21:59:38 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Hit-count-R80-10/m-p/81723#M4726</guid>
      <dc:creator>Carlos_Arzate</dc:creator>
      <dc:date>2020-04-13T21:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: Hit count  R80.10</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Hit-count-R80-10/m-p/81728#M4727</link>
      <description>This command has two parts: the mgmt_cli part, and the jq part.&lt;BR /&gt;The jq part (which is erroring) won't work if the mgmt_cli output isn't what jq expects.&lt;BR /&gt;What's the output of the mgmt_cli part (e.g. everything before the first pipe)?</description>
      <pubDate>Tue, 14 Apr 2020 04:37:29 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Hit-count-R80-10/m-p/81728#M4727</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2020-04-14T04:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: Hit count  R80.10</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Hit-count-R80-10/m-p/81816#M4729</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We need to know what is the hit count of each of their rules&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 14:23:50 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Hit-count-R80-10/m-p/81816#M4729</guid>
      <dc:creator>Carlos_Arzate</dc:creator>
      <dc:date>2020-04-14T14:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: Hit count  R80.10</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Hit-count-R80-10/m-p/81842#M4731</link>
      <description>&lt;P&gt;I understand what you're trying to accomplish.&lt;BR /&gt;The command is most likely correct, but you're not referring to the correct policy name in your command.&lt;BR /&gt;That would cause the error you're seeing.&lt;BR /&gt;However, that's merely a guess.&lt;BR /&gt;The real reason for the failure would be apparent if you just ran the mgmt_cli portion of that command (everything before the first pipe: |).&lt;/P&gt;
&lt;P&gt;To double-check you are referring to the correct layer (which may not be called Network):&lt;BR /&gt;In Security Policies, click the +, then Manage Policies and Layers, then go to Layers &amp;gt; Access Control and make sure you know precisely what layer it is you're trying to get the stats on.&lt;BR /&gt;Replace "Network" with whatever that is in your case in the command.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2020-04-14 at 11.07.53 AM.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/5569i425D2F155F6AC88F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2020-04-14 at 11.07.53 AM.png" alt="Screen Shot 2020-04-14 at 11.07.53 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If that doesn't resolve the issue, please paste the precise output you get when you run just the mgmt_cli portion (without piping it to jq).&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 18:12:00 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Hit-count-R80-10/m-p/81842#M4731</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2020-04-14T18:12:00Z</dc:date>
    </item>
  </channel>
</rss>

