Algolia icon

Algolia

Use Algolia in your n8n workflows

Overview

The "Advanced - Get logs" operation in this Algolia node allows users to query the logs of their Algolia application. This is useful for monitoring and debugging API requests made to Algolia, as it provides access to recent log entries related to API calls. Logs are retained for the last seven days and include up to 1,000 API requests per server.

Typical use cases include:

  • Auditing API usage and request patterns.
  • Troubleshooting errors or unexpected behavior by reviewing error logs.
  • Monitoring build or query operations for performance or issues.

For example, a user might retrieve the last 50 error logs to investigate failed search queries or indexing operations.

Properties

Name Meaning
Offset The starting position (offset) in the logs from which to begin retrieving entries. Default is 0.
Length The number of log entries to retrieve. Maximum allowed is 1000. Default is 10.
Index Name Optionally specify an index name to filter logs related to that specific index. Options: "string" (select an index), or "null" (no index filter).
Type Filter logs by type. Possible values: "all", "query", "build", "error". Default is "all".

Output

The node outputs the retrieved logs in the json field of the output data. Each log entry typically contains details about an API request such as timestamp, type (query/build/error), index involved, and other metadata relevant to the request.

No binary data output is associated with this operation.

Dependencies

  • Requires an API key credential with the appropriate permissions, specifically one that includes the logs access control list (ACL).
  • The node uses the Algolia REST API endpoint /1/logs with GET method to fetch logs.
  • The base URL for requests is constructed using the Algolia Application ID credential.

Troubleshooting

  • Common Issues:

    • Insufficient permissions: If the API key used does not have the logs ACL, the request will fail.
    • Exceeding maximum length: Requesting more than 1000 logs at once is not allowed.
    • No logs available: If no logs exist for the specified filters, the response will be empty.
  • Error Messages:

    • Unauthorized or forbidden errors indicate missing or invalid API key permissions.
    • Validation errors may occur if parameters like length exceed allowed limits or if invalid index names are provided.
  • Resolution Tips:

    • Ensure the API key has the required logs permission.
    • Use valid parameter values within documented ranges.
    • Confirm the index name exists if filtering by index.

Links and References


This summary covers the "Advanced" resource and "Get logs" operation based on the provided properties and bundled source code.

Discussion