The log query system on Avi Load Balancer returns only 10000 logs for a given period since this operation is memory intensive. If the number of logs exceeds 10000, Avi Load Balancer REST API calls are used to check logs for a specific duration or period.
REST API calls to Retrieve Logs for a Certain Duration
REST API to retrieve event logs for the last day:
https://<cluster_ip>/api/analytics/logs?type=2&duration=86400
REST API to retrieve event logs for the last hour:
https://<cluster_ip>/api/analytics/logs?type=2&duration=3600
The above API calls will retrieve only one page of event logs for that particular duration. To retrieve complete event logs, append ‘&page_size=10000’ to the API query. This will fetch up to 10000 event logs.
API to retrieve event logs for the last day with no paging:
https://<cluster_ip>/api/analytics/logs?type=2&duration=86400&page_size=10000
The log query system is limited to returning at most 10000 logs for a given period, going beyond the threshold value is memory intensive. Workaround is to check logs for a shorter period. If the number of event logs exceeds 10000, use the following APIs.
API to retrieve event logs for the last hour:
https://<cluster_ip>/api/analytics/logs?type=2&duration=3600&page_size=10000
API to retrieve event logs for for a specific time period:
https://<cluster_ip>/api/analytics/logs?type=2&duration=3600&page_size=10000&end=2017-11-20T18:00:00 —this will fetch one hours’ events from 1700 to 1800 hours.
API To retrieve logs with a specific start and end time:
https://10.140.4.46/api/analytics/logs?type=2&page_size=10000&start=2017-11-15T10:00:00&end=2017-11-20T18:00:00
What is the maximum number of logs that can be collected for a specific duration on Avi Load Balancer?
The log query system on Avi Load Balancer can return only 10000 logs for a given period because the log collection procedure is memory intensive. If the number of logs goes beyond this number, Avi Load Balancer REST API can be used for a specific duration or period.