The Sumo Logic Python SDK (version 0.1.17) is a community-supported Python interface to the Sumo Logic REST API, designed to simplify interactions with the API in Python code. It provides functionality for various API operations, including content management, search, and collector interactions. The library maintains an active development status with periodic updates, with the latest release in June 2024.
pip install sumologic-sdkVerified import paths — ran on the pinned version, not inferred.
This quickstart initializes the `SumoLogic` client using credentials and an API endpoint, then fetches and prints the first few Sumo Logic collectors. Ensure you have your `SUMO_ACCESS_ID`, `SUMO_ACCESS_KEY`, and `SUMO_ENDPOINT` set as environment variables. The endpoint should match your Sumo Logic deployment (e.g., `https://api.us2.sumologic.com/api`).
Verify your Python environment's TLS configuration. Update Python or OS if necessary.
Always use the correct region-specific API endpoint (e.g., `https://api.us2.sumologic.com/api`, `https://api.eu.sumologic.com/api`). Refer to the Sumo Logic documentation to find your account's deployment endpoint.
Implement exponential backoff and respect any `Retry-After` headers in API responses to avoid being throttled.
Ensure your code handles and passes the session cookie returned by the initial Search Job API call for all follow-up requests to the same job.
Double-check your `SUMO_ACCESS_ID` and `SUMO_ACCESS_KEY` for accuracy. Verify that `SUMO_ENDPOINT` points to the correct region-specific Sumo Logic API URL (e.g., `https://api.us2.sumologic.com/api`).
Ensure that the session cookie returned by the initial `/search/jobs` API call is included in the headers of all follow-up requests to the same search job.
Implement robust retry logic with exponential backoff. Wait for a period, potentially indicated by a `Retry-After` header, before making further requests.
Check network connectivity, DNS resolution (`nslookup collectors.sumologic.com`), and firewall rules from your environment to Sumo Logic's API endpoints.