Skip to content

Python library for sending events to Graylog2 over the Gelf HTTP Input

License

Notifications You must be signed in to change notification settings

tgalyean/pygelf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pygelf

Python library for sending events to Graylog2 over the Gelf HTTP Input

Install

git clone https://github.com/tgalyean/pygelf.git
easy_install pygelf

Configuration

In the directory your code will run in you will need to create a config.ini containing your graylog instance details.

The global parameter allows you to create one config file containing all environments (dev/test/prod) while maintaining a single config.ini.

[global]
env = test

For each environment define your graylog instance

[test]
hostname = testgraylog.mydomain.com
port = 12201

[dev] 
hostname = devgraylog.mydomain.com
port = 12201

[prod]
hostname = prodgraylog.mydomain.com
port = 12201

Example Usage:

#!/usr/bin/env python
from pygelf import Client

client = Client()

try:
    ...something..
except Error as e:
    client.send(e,"local1")

About

Python library for sending events to Graylog2 over the Gelf HTTP Input

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages