Skip to main content

A Python wrapper for the Graylog REST API

Project description

This is a low level Graylog API Wrapper heavily based on the guide by pretzel.

As there are a lot of endpoints not all of them are implemented by now. I started by implementing the GET requests first. Also the API responses all follow very different schemas and an implementation of that into Python is probably not worth the effort which is why the responses from this API are so low-level. Feel free to add endpoints or schemas in PRs if you need them :)

Last tested Graylog Version is: 6.3.4

Example Usage

from graylog_api_client import GraylogAPI

# Initialize the GraylogAPI client
api = GraylogAPI(
    host="https://localhost:9000/api",  # Replace with your Graylog server URL
    api_key="your_api_key_here",       # Replace with your API key
    ssl_verify=True                   # /path/to/cert for custom certificate
)

# Example: Fetch all streams
streams = api.get_streams()

# Print the result
print("Streams:", streams.data)

Planned:

  1. Tests that run against a Graylog instance to check if the Wrapper works after Graylog Updates

Test Environment:

  1. Install docker and docker-compose
  2. Copy the sample docker-compose file by Graylog for the open-core (or enterprise if you want to see all API endpoints) and create a .env file with the needed values
  3. docker-compose up
  4. Log in and create an api-key

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

graylog_api_client-0.1.2.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

graylog_api_client-0.1.2-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file graylog_api_client-0.1.2.tar.gz.

File metadata

  • Download URL: graylog_api_client-0.1.2.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.14.0 Windows/11

File hashes

Hashes for graylog_api_client-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f3be8429fb167feaba8416b2aa1344f473bed598768a6607545deed3db61733c
MD5 7bdee144c998730a082a027d390c0a4b
BLAKE2b-256 944de055ceda8609442fec5cec24a70f6b08d4bf0516ae2d18f2b6e69caf0ffd

See more details on using hashes here.

File details

Details for the file graylog_api_client-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for graylog_api_client-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7a762f0f3e57eae0d41b79bf88c0a9cb123d35516822301cb6a692cd23840ecc
MD5 36f94d55241a84b57fd37b3603be4331
BLAKE2b-256 641467cc531cdea7b9ac88779c11167905fd44109ac56cb2c66b595b57a65bd7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page