Get your logs from Logentries on the comandline
Note: I am no longer using Logentries. If you would like to take over this project to maintain it that would be great! Please email me at firstname.lastname@example.org.
Stream your logs from Logentries on the commandline. Provides the logentries command which makes it easy to call their Download API and pipe it around.
$ pip install logentries-cli
Find your Logentries account key. At time of writing, this can be found at Accounts->Profile and appears when you press the “Show” button:
(Optional) store your account key in the environment variable LOGENTRIES_ACCOUNT_KEY. You could set this up in e.g. your bashrc. Your other option is to always pass it to logentries with --account-key.
Filter your logs! Run with the syntax:
$ logentries <logset> <logname> [-f filter] [-s start] [-e end]
Verbose help for the options is provided with logentries -h.
$ logentries web nginx
With only the required arguments (logset and log) filled in, the last 20 minutes of messages from that log are downloaded. They are streamed so they play nicely with other commandline utilities.
$ logentries web nginx -f code=500
Passing a Logentries filter means that fewer messages are downloaded and you can analyze faster.
$ logentries web nginx -f 'code=500' -s '1am' -e '5 minutes ago'
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, Size & Hash SHA256 Hash Help||File Type||Python Version||Upload Date|
(5.2 kB) Copy SHA256 Hash SHA256
|Wheel||3.4||May 1, 2015|
(16.0 kB) Copy SHA256 Hash SHA256
|Source||None||May 1, 2015|