Falcon Query Language
Falcon Query Language (FQL) is the filtering engine used across the CrowdStrike Falcon API. It allows you to query specific data sets—such as hosts, detections, incidents, and vulnerabilities—by applying precise criteria directly at the API level.
For users of our automation platform, using FQL is the most efficient way to reduce data overhead and ensure your workflows only trigger on the exact events you care about.
1. Core Syntax
Section titled “1. Core Syntax”The standard FQL expression follows a property-operator-value pattern:
property_name:operator'value'
- Property: The specific metadata field (e.g.,
status,hostname). - Operator: Defines the comparison (e.g., equals, greater than).
- Value: The data to match against.
Key Rules
Section titled “Key Rules”- Strings: Must be enclosed in single quotes:
hostname:'SEC-PROD-01'. - Booleans: Must be lowercase without quotes:
is_active:true. - Integers: No quotes required:
confidence:>80. - Dates: Must be UTC ISO-8601 format in single quotes:
last_seen:>'2024-01-01T00:00:00Z'. - Nulls: Use the literal
null:external_id:null.
2. Operators
Section titled “2. Operators”FQL supports a robust set of operators for different data types.
3. Logical Expressions
Section titled “3. Logical Expressions”You can chain multiple filters together to create complex logic.
AND (Represented by +)
Section titled “AND (Represented by +)”Both conditions must be met.
- Example:
platform_name:'Windows'+status:'normal' - Finds Windows hosts that are currently in a normal state.
OR (Represented by ,)
Section titled “OR (Represented by ,)”Either condition can be met.
- Example:
severity_name:'High',severity_name:'Critical' - Finds detections that are either High OR Critical.
Grouping (Parentheses)
Section titled “Grouping (Parentheses)”Use () to define the order of operations, especially when mixing AND and OR logic.
- Example:
platform_name:'Linux',(tags:'Production'+tags:'Web') - Finds Linux hosts that have both the Production and Web tags.
4. Practical Implementation & Examples
Section titled “4. Practical Implementation & Examples”A. Host Management (Falcon Discover / Hosts)
Section titled “A. Host Management (Falcon Discover / Hosts)”Endpoint: GET /devices/queries/devices/v1
Goal: Find all Windows Servers that haven’t been seen in the last 30 days.
FQL Filter
Section titled “FQL Filter”platform_name:'Windows'+product_type_desc:'Server'+last_seen:<'2024-01-15T00:00:00Z'
Example request
Section titled “Example request”GET /devices/queries/devices/v1?filter=platform_name%3A'Windows'%2Bproduct_type_desc%3A'Server'%2Blast_seen%3A%3C'2024-01-01T00:00:00Z' HTTP/1.1Host: [api.crowdstrike.com](http://api.crowdstrike.com/)Authorization: Bearer `<YOUR_ACCESS_TOKEN>`B. Detections Triage
Section titled “B. Detections Triage”Endpoint: GET /detects/queries/detects/v1
Goal: Retrieve specific High/Critical detections that are still “New” and involve “Credential Access”.
FQL Filter (2)
Section titled “FQL Filter (2)”status:'new',max_severity_displayname:['High','Critical']+tactic_id:'T1003'
Example request:
GET /detects/queries/detects/v1?filter=status%3A'new'%2B(max_severity_displayname%3A'High'%2Cmax_severity_displayname%3A'Critical')%2Bbehaviors.tactic_id%3A'T1003' HTTP/1.1Host: [api.crowdstrike.com](http://api.crowdstrike.com/)Authorization: Bearer `<YOUR_ACCESS_TOKEN>`C. Vulnerability Management (Spotlight)
Section titled “C. Vulnerability Management (Spotlight)”Endpoint: GET /spotlight/queries/vulnerabilities/v1
Goal: Find open vulnerabilities with a CVSS score higher than 9.0.
FQL Filter (3)
Section titled “FQL Filter (3)”status:'open'+cve.cvss_v3_base_score:>9.0Example request:
POST /spotlight/queries/vulnerabilities/v1 HTTP/1.1Host: [api.crowdstrike.com](http://api.crowdstrike.com/)Content-Type: application/jsonAuthorization: Bearer `<YOUR_ACCESS_TOKEN>`
{"filter": "status:'open'+cve.cvss_v3_base_score:>9.0","limit": 50,"sort": "updated_timestamp.desc"}5. Sorting with FQL
Section titled “5. Sorting with FQL”Many endpoints also support a sort parameter using FQL syntax.
- Syntax:
property_name.ascorproperty_name.desc - Example:
last_seen.desc(Shows the most recently active devices first).
6. Common Use Cases
Section titled “6. Common Use Cases”7. Pro-Tips for Automation Users
Section titled “7. Pro-Tips for Automation Users”- URL Encoding: If you are making raw HTTP requests, remember that
+(AND) and:(Equals) must be URL encoded (e.g.,+becomes%2B). - Case Sensitivity: While property names are generally lowercase, values within single quotes can be case-sensitive depending on the specific API (e.g.,
status:'new'vsstatus:'New'). Always check the specific endpoint documentation. - Substring Match: To find a string anywhere in a field, use the asterisk on both sides:
hostname:*'test'*. - Exact Match: Use square brackets
[]for an exact match within a list of possible values:status:['new', 'in_progress'].