Overview
Falcon Query Language (FQL) is a powerful filtering syntax used throughout the CrowdStrike Falcon platform. PSFalcon validates and supports FQL statements through the-Filter parameter on most query commands.
What is FQL?
FQL allows you to:- Filter results server-side before they’re returned
- Reduce data transfer and improve performance
- Create complex queries with multiple conditions
- Use operators like wildcards, ranges, and negation
Server-side filtering with FQL is much more efficient than retrieving all results and filtering with PowerShell’s
Where-Object.Basic FQL Syntax
From/home/daytona/workspace/source/private/Private.ps1:1186-1189, FQL statements follow this pattern:
FQL Operators
Exact Match (:)
Exact Match (:)
Match exact value or use wildcards.
Negation (!)
Negation (!)
Exclude results matching the value.
Greater Than (>)
Greater Than (>)
Match values greater than the specified value.
Less Than (<)
Less Than (<)
Match values less than the specified value.
Greater Than or Equal (>=)
Greater Than or Equal (>=)
Match values greater than or equal to the specified value.
Less Than or Equal (<=)
Less Than or Equal (<=)
Match values less than or equal to the specified value.
Pattern Match (~)
Pattern Match (~)
Substring pattern matching.
Negated Pattern (!~)
Negated Pattern (!~)
Exclude substring pattern.
Combining Conditions
AND Operator (+)
Combine multiple conditions that must all be true:OR Operator (,)
Match any of multiple values for a single property:Complex Combinations
Combine AND and OR logic:Common Properties
Frequently used properties for filtering hosts:Host Properties
Host Properties
Date and Time Filtering
Use RFC3339 format for timestamps:/home/daytona/workspace/source/private/Private.ps1:180-191, PSFalcon automatically converts relative time expressions:
Wildcards
Use* for wildcard matching:
FQL Validation
From/home/daytona/workspace/source/private/Private.ps1:1182-1197, PSFalcon validates FQL syntax before submission:
- Property name:
[\w\.]+ - Operator:
:,!,~,!~,>,<,>=,<= - Value:
[\w\d\s\.\-\*\[\]\\,'":]+
Practical Examples
Server-Side vs Client-Side Filtering
Always prefer FQL (server-side) filtering over PowerShell
Where-Object (client-side) filtering.- Reduced data transfer
- Faster execution
- Lower memory usage
- Respects API rate limits better
Combining Filter with Other Parameters
Escaping Special Characters
When filtering on values with special characters:Debugging FQL Queries
Use-Verbose to see the actual query sent to the API:
Common FQL Patterns
Pattern Library
Pattern Library
Field-Specific Considerations
Group Filtering
From/home/daytona/workspace/source/samples/devices/output-devices-with-their-most-recent-login.ps1:12:
IP Address Filtering
Version Filtering
Best Practices
1
Always Use FQL When Available
Server-side filtering is more efficient than client-side.
2
Start Broad, Then Narrow
Test filters incrementally:
3
Use Wildcards Carefully
Leading wildcards can be slower:
4
Validate Before Large Queries
Test FQL syntax with small limits first:
5
Combine with PowerShell When Needed
Use FQL for properties the API supports, PowerShell for complex client-side logic:
FQL Reference by Endpoint
Different endpoints support different filterable properties. Consult the CrowdStrike API documentation or use the Falcon console’s filter builder to discover available properties for each endpoint.Next Steps
Pagination
Combine filtering with pagination to efficiently retrieve large datasets
Authentication
Understand authentication requirements for query operations