Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Readme to show logging to Loggly's Gen2 API #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Pypi: <http://pypi.python.org/pypi/Hoover>



##Using Hoover
##Using Hoover For Searching Loggly


Enter your credentials in hoover.LogglySession after importing:
Expand All @@ -35,6 +35,18 @@ Enter your credentials in hoover.LogglySession after importing:
i.search(q='apache2 error', starttime='NOW-2DAYS', format='csv')
i.search(q='json.priority:err', starttime='NOW-15MINUTES') #Defaults to json if format is left out

##Using Hoover For Logging to Loggly's New API

import logging
from hoover.handlers import LogglyHttpHandler
.
.
.
token_and_suffix = "{token}/tag/http".format(token=YOUR_LOGGLY_TOKEN_FROM_SOURCE_SETUP)
loggly_handler = LogglyHttpHandler(token=token_and_suffix, proxy='logs-01.loggly.com')
logger = logging.getLogger('default')
logger.addHandler(loggly_handler)
logger.critical("This goes straight to my Loggly!")

##Search Properties

Expand Down