POST logset

POST Log Set


Request used to create a new Log Set for 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

POST

Authentication

Owner, Read Write or Read Only key is required.

URL Params

None

Data Params

json
1
{
2
"logset": {
3
"name": "MyLogSet2",
4
"logs_info": [
5
{
6
"id": "63042c50-34a0-421a-aeef-7c313feb944c"
7
}
8
],
9
"user_data": {}
10
}
11
}

Success Response

Code 201Content:

json
1
{
2
"logset": {
3
"id": "9fba111c-52c7-4235-9427-5114ef2d99ce",
4
"name": "My Log Set",
5
"description": null,
6
"user_data": {},
7
"logs_info": [
8
{
9
"id": "0868a0a4-a939-4a9c-9719-711f6d377021",
10
"name": "My Log,
11
"links": [
12
{
13
"rel": "Self",
14
"href": "https://us.rest.logs.insight.rapid7.com/management/logs/0868a0a4-a939-4a9c-9719-711f6d377021"
15
}
16
]
17
}
18
]
19
}
20
}

Sample Call

python
1
import json
2
import requests
3
4
rw_key ='00112233-4455-6677-8899-aabbccddeeff'
5
uri = 'management/logsets'
6
body = {"logset":{"name":"My New LogSet","logs_info":[{"id":"c8c0047e-b5f8-4366-a65a-61a94760a5ee"}],"user_data":{}}}
7
8
def create_logset():
9
url = "https://us.rest.logs.insight.rapid7.com/" + uri
10
headers = {
11
'x-api-key': rw_key,
12
"Content-Type": "application/json"
13
}
14
r = requests.post(url, data=json.dumps(body, separators=(',', ':')), headers=headers)
15
print r.status_code, r.content
16
17
18
def start():
19
create_logset()
20
21
if __name__ == '__main__':
22
start()

Notes