Export your analytics data

Export your analytics data with either the toolkit CLI or the REST API.

The analytics export function in the UIs export just the data that is displayed in the UI, and is limited to 200 API events per page.

To export up to 10,000 API event records, use the toolkit CLI.

To export all your analytics data, use the REST API.
Note: If you plan to export you API event data regularly, consider using the offload feature instead. See Offload to third-party systems.

Exporting with the toolkit CLI

  1. Follow the steps to install and configure the toolkit CLI.
  2. Login with the correct user for the scope of analytics data you want to export. For example, to export all API event from a provider organization called prod, login as a member of that organization:
    apic login --server <platform api endpoint> --username <provider org member> --realm provider/default-idp-2
  3. Use the events command to export your analytics data. For example, to export the events for a provider organization:
    apic -m analytics events:orgList --server <platform api endpoint> --analytics-service <analytics service name> --org <org name> --format=json
    {
        "total": 200,
        "search_time": 7,
        "events": [
            {
                "log_policy": "activity",
    ...
    
    Note: Data is returned as a JSON array, each element is a single API event record.

Exporting with the REST API

  1. Follow the steps to get started with the Analytics REST API.
  2. Use the events API to export your data. For example, to get all analytics API event records from a provider organization, specify the organization's API path:
    curl -v -k -H 'Accept: application/json' -H 'Authorization: Bearer <bearer_token>' -X GET --url 'https://<management_server_api_endpoint>/analytics/<analytics_service>/orgs/<provider_organization>/events'
    
    {
        "total": 45543,
        "search_time": 36,
        "events": [...]
To get just the events for a catalog, specify the catalog in the API path; for example:
/analytics/<analytics_service>/catalogs/<provider_organization>/<catalog>/events