Log Retention Policies
The log retention policy specifies the retention and purge behavior of logs. The policy specifies the maximum history record count and the number of records to purge with a purge interval. Records are periodically purged to contain log growth. When the purge timer triggers, a number of records equal to the Purge Window Size are deleted if the number of records in the log is greater than the Maximum Size.
You can configure the following settings:
-
Maximum Size—The maximum number of records to be maintained in the log. The range is 1000 to 500000 records; the default is 100000 records.
-
Purge Window Size— The maximum number of records to be deleted in a single swipe. Record deletion is performed periodically (every 30 seconds) in batches. The maximum size of a batch should be chosen to avoid spikes in I/O and CPU utilization. The range is 100 to 1000 records; the default is 250 records.
Configuring Log Retention Policies in the GUI
Procedure
Step 1 |
For releases prior to the 4.2(1) release, perform the following substeps: |
Step 2 |
For the 4.2(1) release and later, perform the following substeps: |
Configuring Log Retention Policies in the REST API
For detailed information about configuring the APIC REST API, see the Cisco APIC REST API Configuration Guide.
This example shows how to configure the maximum log size and purge window size for the audit log, the event log, the fault log, and the health log:
POST http://www.ExampleCorp.com/api/mo/uni/appliance.json
{
"applianceInst": {
"attributes": {
"dn": "uni/appliance",
"status": "modified"
},
"children": [{
"aaaCtrlrRetP": {
"attributes": {
"dn": "uni/appliance/ifcaaaretp",
"maxSize": "99999",
"purgeWin": "250"
},
"children": []
}
},{
"eventCtrlrRetP": {
"attributes": {
"dn": "uni/appliance/ifceretp",
"maxSize": "99998",
"purgeWin": "250"
},
"children": []
}
},{
"faultCtrlrRetP": {
"attributes": {
"dn": "uni/appliance/ifcfretp",
"maxSize": "99997",
"purgeWin": "250"
},
"children": []
}
},{
"healthCtrlrRetP": {
"attributes": {
"dn": "uni/appliance/ifchretp",
"maxSize": "99996",
"purgeWin": "250"
},
"children": []
}
}]
}
}
The first section of the response is shown here, showing the fault log settings:
{
"imdata": [{
"applianceInst": {
"attributes": {
"childAction": "deleteNonPresent",
"dn": "uni/appliance",
"lcOwn": "local",
"modTs": "2013-11-22T09:10:26.008+00:00",
"monPolDn": "",
"name": "",
"replTs": "never",
"status": "",
"uid": "0"
},
"children": [{
"faultCtrlrRetP": {
"attributes": {
"childAction": "deleteNonPresent",
"descr": "",
"lcOwn": "local",
"maxSize": "99997",
"modTs": "2013-11-23T08:54:54.601+00:00",
"monPolDn": "",
"name": "FaultCtrlrRetP",
"purgeWin": "250",
"replTs": "never",
"rn": "ifcfretp",
"status": "",
"uid": "0"
}
}
},
.
.
.