cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to check policy hit count

Jump to solution

Hi,

 

I want to verify the number of policy hits of webgateway so that we can disable the unwanted rules from the webgateway console please help.

 

Thank you in advanced 

1 Solution

Accepted Solutions
AaronT
Reliable Contributor
Reliable Contributor
Report Inappropriate Content
Message 2 of 2

Re: How to check policy hit count

Jump to solution

Are you doing this with an on-premise MWG or SaaS rules?  If using SaaS, it's more difficult as we can't get the same logging information.

There are two approaches.  One is to add an event "Statistics.Counter.increment" and setup counters on the rules you want to track.  You then could setup a "block page" to show the counters.

Another option is to create a File System Log called "FiredRules.log" and create a "Last Rule" Rule/Ruleset that always is hit and is a continue.  This rule would be an event that is as follows:

FileSystemLogging.WriteLogEntry (List.OfString.ToString(Rules.FiredRules.Names,"")<FiredRules.log>

That will write the names of all "Fired Rules" during the transaction to the log defined in "FiredRules.log".  It's likely comma separated, so you'd have to do some magic to get what you were looking for.  You'd also likely want to enable log rotation and monitor so you don't fill up your filesystem.

I've used option 2, and prefer it myself.

View solution in original post

1 Reply
AaronT
Reliable Contributor
Reliable Contributor
Report Inappropriate Content
Message 2 of 2

Re: How to check policy hit count

Jump to solution

Are you doing this with an on-premise MWG or SaaS rules?  If using SaaS, it's more difficult as we can't get the same logging information.

There are two approaches.  One is to add an event "Statistics.Counter.increment" and setup counters on the rules you want to track.  You then could setup a "block page" to show the counters.

Another option is to create a File System Log called "FiredRules.log" and create a "Last Rule" Rule/Ruleset that always is hit and is a continue.  This rule would be an event that is as follows:

FileSystemLogging.WriteLogEntry (List.OfString.ToString(Rules.FiredRules.Names,"")<FiredRules.log>

That will write the names of all "Fired Rules" during the transaction to the log defined in "FiredRules.log".  It's likely comma separated, so you'd have to do some magic to get what you were looking for.  You'd also likely want to enable log rotation and monitor so you don't fill up your filesystem.

I've used option 2, and prefer it myself.

You Deserve an Award
Don't forget, when your helpful posts earn a kudos or get accepted as a solution you can unlock perks and badges. Those aren't the only badges, either. How many can you collect? Click here to learn more.

Community Help Hub

    New to the forums or need help finding your way around the forums? There's a whole hub of community resources to help you.

  • Find Forum FAQs
  • Learn How to Earn Badges
  • Ask for Help
Go to Community Help

Join the Community

    Thousands of customers use our Community for peer-to-peer and expert product support. Enjoy these benefits with a free membership:

  • Get helpful solutions from product experts.
  • Stay connected to product conversations that matter to you.
  • Participate in product groups led by employees.
Join the Community
Join the Community