Introduction to Event Analytics and Logging

If you’re not already familiar with API Analytics, you should first check out API Analytics: The Ultimate Guide to Grow Your Platform Business eBook

The Events screen allows you to get user-centric insights into API usage and user behaviors. Moesif’s platform leverages high-cardinality, high-dimension analytics. This means you can filter and aggregate billions of API calls and custom actions on pretty much any field even if it’s a high-cardinality field like a session token or user id.

A high-cardinality field is a field that contains a large number of distinct values. A field like userID, which is unique for each user, would be considered a field with high-cardinality.

Searching REST API logs

Filters

Events can filtered by event filters, user filters, and company filters.

Events can be part of two distinct types: API calls and Actions. By analyzing both, you’re able to understand usage of your application or platform better. This is because analyzing both allows for a holistic picture of the end-to-end user journey, across the API or the website.

Filter Type Description
Event filters Enable you to filter by any API call or Actions fields like the request URI, response status, HTTP headers. Some fields are specific to API calls only such as Status Code whereas others are specific to Actions such as Action Name. The property Event Type specifies whether the event is an API Call or Actions
User filters Enable you to filter by user demographics of the user who performed the event.
Company filters Similar to user filters but enables filtering at the account level (Useful for B2B companies)

All three filters enable filtering on custom metadata such as Event Metadata, User Metadata, and Company Metadata.

Search Operator

To enter a custom query expression, select search as the filter operator. This enables you to search on single terms within your text fields such as a title or description field.

The search operator the following special characters:

  • + to AND search terms
  • | to OR search terms
  • - negates a single search term (NOT operator)
  • " wraps a set of search terms
  • * wildcard operator that can be used at the start or end of any term
  • ( and ) for operator precedence

For example, if you want to only match against URI Route that does not start with /v4/, then enter -"/v4/"* as a search term:

Does not start with /v4

Views

You can select different search views such as Event Log, Time Series, Segmentation, Geo Heatmap, and SmartDiff from the Chart Type Selector in the top left of the Events screen.

Chart type selector Navigation

You can also create a new chart by clicking the Create New button and selecting the view/chart type that you’d like to create.

Chart type from Create new button

Event filters

Filter Description
Request URI Route Moesif will detect what your URI route/template is from raw URIs. For example, the URI /widgets/12345 will map to a URI route of /widgets/:id
Request HTTP Verb The HTTP Verb or Method such as GET or POST
Request IP Address At the moment, Moesif supports filtering by IPv4 addresses.
Request City, Request Region, Request Country These filters are for the location of the requesting client via geo ip lookup
Request Timezone Timezone of the requesting client via geo IP lookup
API Version If you set an API version using the SDKs, you can filter on version.
User Agent, OS, Device These filters are for the data in the request’s User-Agent header.
Response Code This is the HTTP status code such as _500_ or 404
request.query.[Header Key] You can filter on any URL query parameter such as pagination parameters
request.headers.[Header Key] You can filter on any HTTP request header such as Content-Type
response.headers.[Header Key] Like request, can filter on any HTTP response header such as Content-Type
Event Type You can either pick API Call or Actions
Action Name For custom actions, this is the name of the action such as “Sign In” or “Purchased Plan”
Event Id Each API call is tagged with an event id. If you know the event id (i.e. you printed it in debug logs), you can enter it here.
API Key/Session Token The API key or session token used when making the API call such as a token in the Authorization request header. View identification of users
Elapsed Time (ms) Range filter for the duration of the API call.
Direction For API Calls only, you can select _Incoming” to show only API calls to your own services you provide, or select “Outgoing” to only show API calls going out to a third party service.
metadata.[field key] Custom fields set in the event metadata

If your API is a GraphQL API, most will automatically add a secondary set of filters called GraphQL Query Filters, parsed from the GraphQL query.

User fields

Filter Description
User Id If you need to bring up API calls for a specific end-user, you can enter the user id here. You should call identifyUser() in the appropriate SDK for this to be accurate.
User Name Filter by associated user’s name after setting it in the user metadata
User Phone Filter by associated user’s phone number after setting it in the user metadata
User Email Filter by associated user’s email after setting it in the user metadata
user.campaign.[field key] Referrer and UTM parameters to track effectiveness of your acquisition channels. Set automatically by moesif-browser-js, but not with server side SDKs
user.metadata.[field key] user demographics or other properties you store in the user metadata

Company fields

Filter Description
Company Id If you need to bring up API calls for a specific end-company, you can enter the company id here. You should call identifyCompany() in the appropriate SDK for this to be accurate.
Company DomainName Filter by associated company’s website domain after setting it in the company metadata
company.campaign.[field key] Referrer and UTM parameters to track effectiveness of your acquisition channels. Set automatically by moesif-browser-js, but not with server side SDKs
company.metadata.[field key] company demographics or other properties you store in the company metadata

API protocol support

Moesif supports a variety of API protocols including RESTful, GraphQL, and Ethereum Web3 (JSON-RPC) APIs.

Please see the documentation for GraphQL Support and JSON-RPC Support for protcol specific features.

Bookmarkable URLs

Moesif persists any active search criteria to the browser window’s URL, so that you can pass your browser tab’s URL to a teammate and they will also see the same filters applied by you without requiring them to re-enter those filter parameters. This makes sharing and saving your favourite search easy to do.

Sharing Workspaces

Moesif allows you to select specific data to share with the partners or customers without exposing all your API data. After filtering for the correct data, click on the Share button to create publicly accessible link.

For more information on sharing a workspace, visit our Sharing Workspaces documentation.

Create Shared Link button

Updated: