GET Specific Saved Query
GET Saved Query
Request used to get a specific Saved Query
URL
https://REGION.rest.logs.insight.rapid7.com/query/saved_queries
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
queryid=[UUID]
Example Value: de305d54-75b4-431b-adb2-eb6b9e546014
Data Params
None
Success Response
Code 200Content:
json
1{2"saved_query": {3"logs": [],4"id": "00000000-0001-bd8a-0000-000000000000",5"leql": {6"during": {7"to": null,8"from": null,9"time_range": null10},11"statement": "where(bytes > 10) calculate(AVERAGE:connect)"12},13"name": "My-Search"14}15}
Error Response
If the Saved Query can not be found
Code 404 NOT FOUND
Sample Call
python
1import requests2import json3import time456API_KEY = 'YOUR API KEY GOES HERE'7QUERY_ID = 'YOUR QUERY ID GOES HERE'89def handle_response(resp):10response = resp11time.sleep(1)12if response.status_code == 200:13print json.dumps(resp.json(), indent=4)14else:15print response.status_code161718def make_request(provided_url=None):19headers = {'x-api-key': API_KEY}2021url = "https://us.rest.logs.insight.rapid7.com/query/saved_queries/" + QUERY_ID22req = requests.get(url, headers=headers)23return req242526def print_query():27req = make_request()28handle_response(req)2930def start():31print_query()323334if __name__ == '__main__':35start()
Notes
Did this page help you?