How To
ForgeRock Identity Platform
Does not apply to Identity Cloud

How do I clear stats logs in AM (All versions)?

Last updated Apr 13, 2021

The purpose of this article is to provide information on clearing your stats logs in AM when they get too large and you no longer need them. It assumes you are using a UNIX® or Linux® system. Clearing stats logs as opposed to deleting them negates the need to stop and start your AM server.


2 readers recommend this article

Clearing an individual stats log

You can clear an individual stats log as follows from your terminal window:

  1. Change directory to your stats directory (which is typically located in the /path/to/openam/var directory (AM 7 and later) or the /path/to/openAM directory (Pre-AM 7)).
  2. Enter the following command: $ cat /dev/null >[filename]replacing [filename] with the name of the stats log file you want to clear.

Clearing all stats logs in the stats directory

You can clear all stats logs in the stats directory as follows:

  1. Enter the following command in your terminal window: $ for file in /path/to/stats/*; do > $file; done to empty all the stats log files in the stats directory.

Alias

You could also create an alias to run this command to make it easy to re-use. For example, enter the following command:

$ alias flushamstats='for file in /path/to/stats/*; do > $file; done'

and then just enter the following command to run it at any time:

$ flushamstats

See Also

How do I change the location of the stats logs in AM (All versions)?

How do I stop stats logging in AM (All versions)?

How do I clear debug logs in AM (All versions)?

How do I rotate AM 5.x and 6.x debug logs?

Related Training

N/A

Related Issue Tracker IDs

N/A


Copyright and Trademarks Copyright © 2021 ForgeRock, all rights reserved.