cs_query_alerts 
Note:
-
Access to this operator is provided on a limited-availability basis. Contact Anomali Customer Support for more information.
-
The
cs_query_alertsoperator replaces thecs_query_detectsoperator, which is now deprecated. See Migration for details.
Use the cs_query_alerts operator to search for alerts using a filter specified in CrowdStrike Falcon Query Language (FQL).
The search results are returned in the resources array (displayed as the RESOURCES column in the UI). You can reference this array in subsequent CrowdStrike operators, such as cs_get_alert_entities, to retrieve alert details for the listed alerts.
Syntax
| cs_query_alerts [cs_filter=<filter> cs_sort=<sort_criteria> cs_limit=<max_results> cs_offset=<offset> cs_include_hidden=<boolean>]
cs_filter=<filter>
|
Optional. Specify a CrowdStrike Falcon Query Language (FQL) filter expression to reduce the number of results. The expression format is as follows: For example:
|
cs_sort=<sort_criteria>
|
Optional. Specify a sort criteria by which to sort the results.
Specify the sort order: |
cs_limit=<max_results>
|
Optional. Specify the maximum number of results to return. Default value: Maximum value: |
cs_offset=<offset>
|
Optional. Specify the number of results to skip before returning results. Use in conjunction with Default value: |
cs_include_hidden=<boolean>
|
Optional. Specify whether to include hidden alerts. Possible values:
Default value: |
Offsetting Query Results
When using pagination with the cs_query_alerts operator, the combined value of cs_limit and cs_offset must not exceed 10,000. This restriction is enforced by the CrowdStrike API and defines the maximum accessible result window. As a result, pagination is supported only within the first 10,000 matching records.
If a query returns more than 10,000 results, additional records cannot be retrieved using offset-based pagination alone. To access the full dataset, refine the query using filters (for example, time range, severity, or other attributes) to reduce the result set and page through each filtered subset separately.
Examples
Example 1: Query new alerts with a limit of 500 results.
| cs_query_alerts cs_filter="status:'new'" cs_limit=500
Example 2: Query high-severity alerts (≥ 50) sorted by last behavior in descending order.
| cs_query_alerts cs_filter="severity:>=50" cs_sort="last_behavior|desc"
Example 3: Query up to 300 new alerts and skip the first 100 matching alerts.
| cs_query_alerts cs_filter="status:'new'" cs_limit=300 cs_offset=100
Example 4: Query five alerts, retrieve output in resources, extract process IDs that triggered the alerts, and get details about these process IDs in processid. For more information on resources, see the operator description above.
| cs_query_alerts cs_limit=5
| cs_get_alert_entities cs_id_list=resources
| calc processid = json_extract(response, "triggering_process_graph_id")
| cs_get_process_detail cs_id_list=processid
Migration
The cs_query_detects operator is deprecated and replaced by cs_query_alerts. If you currently use cs_query_detects to retrieve alert data, update your queries to use cs_query_alerts.
Use the following example to migrate existing queries to the cs_query_alerts operator:
| Before | After |
|---|---|
| cs_query_detects cs_filter="status:'new'"
|
| cs_query_alerts cs_filter="status:'new'"
|