How to view logs on Avi Vantage for a specific duration

Background

The log query system on Avi Vantage returns only 10000 logs for a given period since this operation is memory intensive. If the number of logs exceeds 10000, Avi REST API calls are used to check logs for a specific duration or period.

Instructions

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. Work around 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