- CheckMates
- :
- Products
- :
- Developers
- :
- API / CLI Discussion
- :
- Hit count R80.10
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Are you a member of CheckMates?
×- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hit count R80.10
Good day guys,
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
Currently we try to execute this command but is not working.
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 > hits.csv
And when I did execute shown this error
error: number is not defined
.rulebase[] | select(.hits.value == 0) | [.rule-number , .name , .comments , .enabled ] | @csv 1 compile error
Could you help me with this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The jq part (which is erroring) won't work if the mgmt_cli output isn't what jq expects.
What's the output of the mgmt_cli part (e.g. everything before the first pipe)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
We need to know what is the hit count of each of their rules
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I understand what you're trying to accomplish.
The command is most likely correct, but you're not referring to the correct policy name in your command.
That would cause the error you're seeing.
However, that's merely a guess.
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: |).
To double-check you are referring to the correct layer (which may not be called Network):
In Security Policies, click the +, then Manage Policies and Layers, then go to Layers > Access Control and make sure you know precisely what layer it is you're trying to get the stats on.
Replace "Network" with whatever that is in your case in the command.
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).
