Skip to main content

Overview

The Custom Log Integration sends your application logs directly to Profound’s analytics platform using a standardized JSON format. This integration supports batch processing of logs and validates each entry to ensure data quality, with detailed feedback on any validation issues.

Prerequisites

  • Your Profound Log Ingestion Token
  • The ability to send HTTP POST requests from your application/infrastructure

API specification

Endpoint

Authentication

Include your Profound Log Ingestion Token in the request header:

Request format

Logs must be sent as an array of JSON objects. Each log entry requires specific fields:

Required fields

  • timestamp - Event timestamp (Unix timestamp or ISO 8601 string)
  • method - HTTP method (max 10 characters)
  • host - Request hostname (max 255 characters)
  • path - Request path (max 2048 characters)
  • status_code - HTTP status code (range: 100-599)
  • ip - Client IP address (max 45 characters)
  • user_agent - User agent string (max 1024 characters)

Optional fields

Both query_params and referer are optional. However, if you do not provide either, human referral data will not be available in your dashboard.
  • query_params - Query parameters (key max: 100 chars, value max: 1000 chars)
  • referer - Request referer (max 2048 characters)
  • bytes_sent - Response size in bytes (must be >= 0)
  • duration_ms - Request duration in milliseconds (must be >= 0)
Each request can contain up to 1,000 log entries. For larger datasets, split your logs into multiple requests.

Implementation guide

Custom Detected
1

Format your logs

Prepare your log data in the required JSON format:
2

Send the request

Send logs using your programming language:Python:
Node.js:
3

Handle the response

Process the API response to confirm successful ingestion or handle any errors:Successful response:
Response with validation errors:

Error handling

The API handles errors in the following ways:

Validation errors

For expected validation issues (invalid timestamps, malformed data, etc.), the API does the following:
  • Continues processing valid entries in the batch
  • Adds validation errors to the errors array in the response
  • Returns a 200 status code with processed entries and errors

Unexpected errors

For unexpected errors (server issues, database problems, etc.), the API does the following:
  • Returns a 500 status code
  • Returns an error message in the response detail field
  • Doesn’t process any entries in the batch

Best practices

  • Group logs into batches of up to 1,000 entries
  • Implement retry logic for failed requests
  • Use background processing for log submission
  • Send logs asynchronously to avoid impact on application performance
  • Consider implementing local buffering
  • Use compression for large payloads

Support

Security considerations

  • Store Log Ingestion Tokens securely
  • Regularly rotate Log Ingestion Tokens
  • Monitor request logs for unusual patterns
  • Use HTTPS for all API requests