Analytics CLI
How to access your analytics data with the toolkit CLI.
About this task
Procedure
- Install the toolkit: Setting up the API Connect toolkit
- Log in with the CLI. For example,
Where,apic login --server <platform api endpoint> --username <username> --realm <realm>
<platform api endpoint>
is the FQDN or base URL of your platform API endpoint, for example:platform.example.com
orhttps://platform.example.com
<username>
is the provider org owner. To access cloud scoped data, login as the admin user.<realm>
is the user registry realm for the specified<username>
. By default the realm for provider organization owners isprovider/default-idp-2
. The realm for cloud admin users isadmin/default-idp-1
.
- View the available toolkit analytics commands by using
-m analytics -h
.Exampleapic -m analytics -h
... Available Commands: Creating applications and artifacts config Manage configuration variables Publishing to the cloud clustermgmt Clustermgmt operations dashboards Dashboards operations events Events operations filterparams Filterparams operations Other commands licenses Review the license for API Connect validate Validate an API or product definition version Get the API Connect toolkit version ...
- View your analytics events by using the
events
commands.apic -m analytics events -h Type "apic [command] --help" for help on the following related commands: events:catalogCount Count events at catalog scope. events:catalogGet Get specific event at catalog scope. events:catalogList List events at catalog scope. events:cloudCount Count events at cloud scope. events:cloudGet Get specific event at cloud scope. events:cloudList List events at cloud scope. events:orgCount Count events at organization scope. events:orgGet Get specific event at organization scope. events:orgList List events at organization scope. events:spaceCount Count events at space scope. events:spaceGet Get specific event at space scope. events:spaceList List events at space scope. # To get a count of all API events at cloud level: apic -m analytics events:cloudCount --analytics-service <analytics service name> --server <management server api endpoint> --format=json { "total": 200 } # To get all the cloud level events: apic -m analytics events:cloudList --analytics-service <analytics service name> --server <management server api endpoint> --format=json { "total": 200, "search_time": 7, "events": [ { "log_policy": "activity", ...