Get detections sort date #574
-
Hello everyone! I just started to work with this library and I'm loving it. It helps me a lot. Congrats for the best effort of all contributors! I've just tried to make some tests of data gathering of detections sorting by date but it is returning http 400 error and I don't understand what I'm doing wrong. Could anyone give me some help? Follow the example: from falconpy import Detects falcon = Detects(client_id="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", date_range = { response = falcon.get_aggregate_detects(date_ranges=[date_range]) RESULT python3.9 /home/bruce/PROJECTS/FALCON/get_aggregates.py |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi @brucelourenco! Are you sure you need the aggregate data? You can get a list of detection IDs sorted by date and then look up their details using the following: from falconpy import Detects
falcon = Detects(client_id="ID HERE", client_secret="SECRET HERE")
response = falcon.query_detects(sort="last_behavior|desc")
if response["status_code"] == 200:
if response["body"]["resources"]:
results = falcon.get_detect_summaries(ids=response["body"]["resources"])
print(results)
else:
print("Unable to retrieve detections list.") More examples of using the Detects service collection can be found here: https://github.com/CrowdStrike/falconpy/tree/main/samples/detects |
Beta Was this translation helpful? Give feedback.
Hi @brucelourenco!
Are you sure you need the aggregate data? You can get a list of detection IDs sorted by date and then look up their details using the following:
More examples of using the Detects service collection can be found here: https://github.com/CrowdStrike/falconpy/tree/main/samples/detects