Setting a Retention Policy (CLI)

Use the following task to set a retention policy, which limits the amount of data collected over a retention period. To preserve disk space, it is strongly recommended that you set retention policies to meet your minimum business requirements. The maximum retention period is two years, or 17520 hours.

  1. Go to analytics settings.
    hostname:> analytics settings
  2. Enter show to view a list of data retention properties.
    hostname:analytics settings> show
    Properties:
                retain_second_data = all
                retain_minute_data = all
                  retain_hour_data = all
                   hostname_lookup = true
  3. Set the data retention interval and define a retention policy.

    The retention policy is measured in hours. If you want to set your policy to a certain number of days, weeks, or months, you must first calculate the number of hours in that period. In the following example, set retain_second_data=72 retains data recorded at a per-second interval for 72 hours, or 3 days.

    hostname:analytics settings> set retain_second_data=72
             retain_second_data = 3 days (uncommitted)
  4. Enter commit.
    hostname:analytics settings> commit