- Notifications
You must be signed in to change notification settings - Fork4
Python wrapper for Rapid7 Insight Logsearch API
License
NotificationsYou must be signed in to change notification settings
seamusc/lepy
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
lepy is a Python library to enable access to the Rapid7Log Search API in an easy to use, programatic manner.
python setup.py install
>>> 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 9228/01/19 17:51:11.751000 3328/01/19 15:27:11.751000 1228/01/19 13:03:11.751000 1328/01/19 10:39:11.751000 1428/01/19 08:15:11.751000 13428/01/19 05:51:11.751000 8028/01/19 03:27:11.751000 10528/01/19 01:03:11.751000 38627/01/19 22:39:11.751000 101