Extracting Avi Controller Events and VS App Logs using the API Call
search cancel

Extracting Avi Controller Events and VS App Logs using the API Call

book

Article ID: 408754

calendar_today

Updated On:

Products

VMware Avi Load Balancer

Issue/Introduction

Customers often need to extract events and logs from the Avi Controller for troubleshooting, monitoring, or integration with external systems. Avi provides a REST API that allows retrieval of detailed events and logs with flexible filters.

Resolution

API Reference

  • Base endpoint:

    https://<controller-ip>/api/analytics/logs
  • Full documentation on available filters and parameters can be accessed at the same endpoint.

 

General API Syntax

 
GET /api/analytics/logs?type=2&duration=<duration>&end=<end-time>&filter=<filter>&orderby

type=2 → Fetches event logs.

 

Sample API Call for extracting the Events

 
https://<controller-ip>/api/analytics/logs/?type=2&duration=604800&filter=co(event_pages%2CEVENT_PAGE_ALL)&filter=ne(internal%2CEVENT_INTERNAL)&orderby=-report_timestamp&page_size=30&page=1&include_name=true

Explanation of filters in sample:

  • duration=604800 → Last 7 days.

  • filter=co(event_pages,EVENT_PAGE_ALL) → Includes all event pages.

  • filter=ne(internal,EVENT_INTERNAL) → Excludes internal-only events.

  • orderby=-report_timestamp → Sorts results with latest first.

  • page_size=30&page=1 → Fetch first page with 30 results.

  • include_name=true → Adds object names for readability.

 

 

 

Sample API Call – Extracting Virtual Service Application Logs

 
https://<controller-ip>/api/analytics/logs?type=1&virtualservice=<vs-uuid>&duration=604800

Example:

 
https://<controller-ip>api/analytics/logs?type=1&virtualservice=virtualservice-4c6963b9-c4fe-4191-b67c-3f0c172ad763&duration=604800

Explanation of Parameters:

  • type=1 → Retrieves application logs.

  • virtualservice=<vs-uuid> → Filters logs for the specific Virtual Service (UUID shown).

  • duration=604800 → Time window for logs in seconds (example = ~7 days).





    Note:

     

    • Ensure API calls are made with a valid session cookie or API token.

    • Pagination (page, page_size) is recommended for large datasets.

    • The Other way is to use your browser’s Developer Tools to inspect the API call made by the GUI. You can then copy that request and paste it directly into the browser’s address bar to view the raw response, which will include the full timestamp.

     



Refer this doc for more information:

https://techdocs.broadcom.com/us/en/vmware-security-load-balancing/avi-load-balancer/avi-load-balancer/31-1/monitoring-and-operability-guide/application-monitoring/viewing-logs-on-avi-vantage-for-a-specific-duration.html