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.
# Exclude specific platformGet-FalconHost -Filter "!platform_name:'Windows'"# Exclude specific statusGet-FalconHost -Filter "!status:'contained'"
Greater Than (>)
Match values greater than the specified value.
# Hosts seen after a dateGet-FalconHost -Filter "last_seen:>'2024-01-01T00:00:00Z'"# Detection severity greater than 50Get-FalconDetect -Filter "max_severity:>50"
Less Than (<)
Match values less than the specified value.
# Hosts seen before a dateGet-FalconHost -Filter "first_seen:<'2024-01-01T00:00:00Z'"# Low severity detectionsGet-FalconDetect -Filter "max_severity:<30"
Greater Than or Equal (>=)
Match values greater than or equal to the specified value.
Get-FalconDetect -Filter "max_severity:>=70"
Less Than or Equal (<=)
Match values less than or equal to the specified value.
Combine multiple conditions that must all be true:
# Windows hosts with normal statusGet-FalconHost -Filter "platform_name:'Windows'+status:'normal'"# Multiple AND conditionsGet-FalconHost -Filter "platform_name:'Windows'+status:'normal'+last_seen:>'2024-01-01T00:00:00Z'"# With wildcardsGet-FalconHost -Filter "hostname:'DESKTOP-*'+platform_name:'Windows'"
# (Windows OR Linux) AND normal statusGet-FalconHost -Filter "platform_name:['Windows','Linux']+status:'normal'"# Multiple conditions with exclusionsGet-FalconHost -Filter "platform_name:'Windows'+!status:'contained'+last_seen:>'2024-01-01T00:00:00Z'"
From /home/daytona/workspace/source/private/Private.ps1:1182-1197, PSFalcon validates FQL syntax before submission:
# Valid FQLGet-FalconHost -Filter "hostname:'DESKTOP-*'" # OK# Invalid FQL (missing operator)Get-FalconHost -Filter "hostname"# Error: 'hostname' is not a valid Falcon Query Language statement# Invalid FQL (incorrect syntax)Get-FalconHost -Filter "hostname=DESKTOP-123"# Error: 'hostname=DESKTOP-123' is not a valid Falcon Query Language statement
# Backslash in domain namesGet-FalconHost -Filter "machine_domain:'CORP.EXAMPLE.COM'"# Single quotes in values (use double quotes for outer string)Get-FalconHost -Filter "hostname:'O''Brien-PC'"# Spaces in valuesGet-FalconHost -Filter "os_version:'Windows 10'"
# Active hosts (seen in last 24 hours)"last_seen:>'last 24 hours'"# Stale hosts (not seen in 90 days)"last_seen:<'last 90 days'"# Production servers"hostname:'*-PROD-*'"# Non-production environments"hostname:['*-DEV-*','*-TEST-*','*-QA-*']"# Specific platforms"platform_name:['Windows','Linux']"# Contained or pending containment"status:['contained','containment_pending']"# Recent first_seen (new devices)"first_seen:>'last 7 days'"# Specific domain"machine_domain:'corp.example.com'"# Outside corporate network"!local_ip:['10.*','172.16.*','192.168.*']"# Outdated agent versions"!agent_version:>'7.0.0'"
From /home/daytona/workspace/source/samples/devices/output-devices-with-their-most-recent-login.ps1:12:
# Filter by host group ID (use single quotes around ID)Get-FalconHost -Filter "groups:['abc123def456789012345678901234ab']" -All# Multiple groups (OR)Get-FalconHost -Filter "groups:['group-id-1','group-id-2']" -All
# Exact IPGet-FalconHost -Filter "local_ip:'192.168.1.100'"# IP range with wildcardGet-FalconHost -Filter "local_ip:'192.168.1.*'"# Multiple IPsGet-FalconHost -Filter "local_ip:['192.168.1.100','192.168.1.101']"
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.