Skip to main content

Flask Graylog client

Project description


Graylog extension for Flask


First, install flask-graylog using pip:

$ pip install flask-graylog

Auth extension

To enable Graylog auth, add a GraylogAuth instance to your code:

from flask import current_app as app
from flask_graylog.auth import GraylogAuth

   "GRAYLOG_URL": ""

auth = GraylogAuth(app)

You can take a look at examples/ for more complete example. Flask’s application factories and blueprints.

It provides a login decorator login_required. To use it just wrap a view function:

def secret_page():
    return jsonify({
        "message": "hello",
        "username": auth.username

Additionnal info can be accessed using g.user (see: Graylog REST API result of GET /users/{username})

NOTE: Graylog tokens are supported, take a look at the Graylog REST API documentation.

API client

To use query Graylog API, add a GraylogAPIServer instance to your code:

from flask import Flask
from flask_graylog.server import GraylogAPIServer

app = Flask(__name__)
    "GRAYLOG_URL": "",
    "GRAYLOG_USERNAME": "admin",
    "GRAYLOG_PASSWORD": "admin"

api = GraylogAPIServer(app)

You can take a look at examples/ for a complete example.


Apache License 2.0

Project details

Download files

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

Files for flask-graylog-bundle, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size flask-graylog-bundle-0.0.1.tar.gz (3.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page