GithubHelp home page GithubHelp logo

adamchainz / logentries-cli Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 5.0 55 KB

:ledger: Get your logs from Logentries on the comandline.

License: GNU General Public License v3.0

Makefile 14.40% Python 85.60%

logentries-cli's Introduction

logentries-cli


Unmaintained: I'm no longer maintaining this package because I am no longer using Logentries. If you want to continue its maintenance please contact me.


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.

Setting up

  1. Install it:

    $ pip install logentries-cli
    
  2. Find your Logentries account key. At time of writing, this can be found at Accounts->Profile and appears when you press the "Show" button:

    https://raw.github.com/adamchainz/logentries-cli/master/account-key.png
  3. (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.

  4. 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.

Examples

$ 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'

A wide variety of date/time formats are supported for specifying the start and end of the time period to fetch messages for, thanks to the awesome parsedatetime and dateutil.

logentries-cli's People

Contributors

adamchainz avatar michaelaquilina avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

logentries-cli's Issues

Better help

Should document WHERE to get the account key (settings> profile) and expand full installation and usage on this page.

UnicodeEncodeError: 'ascii' codec can't encode character u'\u200e' in position 196: ordinal not in range(128)

I'm running this command:

logentries application app -s 'yesterday' | grep /api/app/ > ratelimiting_api.log

stderr looks like so:

/usr/local/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Traceback (most recent call last):
  File "/usr/local/bin/logentries", line 204, in <module>
    sys.exit(main(**kwargs))
  File "/usr/local/bin/logentries", line 124, in main
    print(line.decode('utf-8'))
UnicodeEncodeError: 'ascii' codec can't encode character u'\u200e' in position 196: ordinal not in range(128)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.