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
1import json2import requests34rw_key ='00112233-4455-6677-8899-aabbccddeeff'5uri = 'management/logsets'6body = {"logset":{"name":"My New LogSet","logs_info":[{"id":"c8c0047e-b5f8-4366-a65a-61a94760a5ee"}],"user_data":{}}}78def create_logset():9url = "https://us.rest.logs.insight.rapid7.com/" + uri10headers = {11'x-api-key': rw_key,12"Content-Type": "application/json"13}14r = requests.post(url, data=json.dumps(body, separators=(',', ':')), headers=headers)15print r.status_code, r.content161718def start():19create_logset()2021if __name__ == '__main__':22start()
Notes
Did this page help you?