GET Logsets

GET Log Sets


Request used to get all Log Sets from an account

URL

https://REGION.rest.logs.insight.rapid7.com/management/logsets

REGION is the data center for your account - e.g. "us" or "eu"

Method

GET

Authentication

Owner, Read Write or Read Only key is required.

URL Params

None

Data Params

None

Success Response

Code 200Content:

json
1
{
2
"logsets": [
3
{
4
"user_data": {},
5
"logs_info": [
6
{
7
"id": "4c1e08f2-0398-48a5-9325-ac190e2f79e8",
8
"links": [
9
{
10
"href": "https://us.rest.logs.insight.rapid7.com/management/logs/4c1e08f2-0398-48a5-9325-ac190e2f79e8",
11
"rel": "Self"
12
}
13
],
14
"name": "My Log"
15
},
16
{
17
"id": "f15ad4cf-fe7d-4b7a-86b0-924997c1d8be",
18
"links": [
19
{
20
"href": "https://us.rest.logs.insight.rapid7.com/management/logs/f15ad4cf-fe7d-4b7a-86b0-924997c1d8be",
21
"rel": "Self"
22
}
23
],
24
"name": "My Other Log"
25
}
26
],
27
"description": null,
28
"id": "814241d4-a14a-4c98-b059-b30978baf951",
29
"name": "My LogSet"
30
},
31
{
32
"user_data": {},
33
"logs_info": [],
34
"description": null,
35
"id": "d25737e8-7135-4b48-b0f8-4b4b5b60b358",
36
"name": "My Empty Log Set"
37
}
38
]
39
}

Sample Call

python
1
import requests
2
import json
3
import time
4
5
API_KEY ='00112233-4455-6677-8899-aabbccddeeff'
6
7
def handle_response(resp):
8
response = resp
9
time.sleep(1)
10
if response.status_code == 200:
11
print json.dumps(resp.json(), indent=4)
12
else:
13
print response.status_code
14
15
def make_request(provided_url=None):
16
headers = {'x-api-key': API_KEY}
17
18
url = "https://us.rest.logs.insight.rapid7.com/management/logsets"
19
req = requests.get(url, headers=headers)
20
return req
21
22
23
def get_logsets():
24
req = make_request()
25
handle_response(req)
26
27
def start():
28
get_logsets()
29
30
if __name__ == '__main__':
31
start()

Notes