Skip to content

Get detections sort date #574

Answered by jshcodes
brucelourenco asked this question in Q&A
Discussion options

You must be logged in to vote

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

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@brucelourenco
Comment options

@jshcodes
Comment options

@brucelourenco
Comment options

Answer selected by jshcodes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
detects Detections issues and questions
2 participants