Coder Social home page Coder Social logo

lepy's Introduction

LogSearch API

Build Status

lepy is a Python library to enable access to the Rapid7 Log Search API in an easy to use, programatic manner.

Install

python setup.py install

Example usage

>>> from logsearch.logsearch import LogSearch
>>> ls = LogSearch(API_KEY)
>>> web_log_id = 'e1dc8460-c28e-434e-b990-dd0faea894a8'
>>> query = 'where(response_code=500) calculate(count)'
>>> result = ls.search(log_ids=[web_log_id], query=query, time_range='Last 24 Hours')
Progress |################################| 100% 4s 0:00:00
>>> print result.display()
{
    "during": {
        "from": 1548706511751, 
        "time_range": "last 24 hours", 
        "to": 1548792911751
    }, 
    "statement": "where(response_code=500) calculate(count)"
}
Statistics response calculate( count )
Timestamp                   count
------------------------  -------
28/01/19 20:15:11.751000       92
28/01/19 17:51:11.751000       33
28/01/19 15:27:11.751000       12
28/01/19 13:03:11.751000       13
28/01/19 10:39:11.751000       14
28/01/19 08:15:11.751000      134
28/01/19 05:51:11.751000       80
28/01/19 03:27:11.751000      105
28/01/19 01:03:11.751000      386
27/01/19 22:39:11.751000      101

lepy's People

Contributors

seamusc avatar scawley-r7 avatar

Watchers

James Cloos avatar

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.