Overview
AWX provides powerful filtering and search capabilities based on Django REST Framework andansible_base.rest_filters.rest_framework.field_lookup_backend.FieldLookupBackend.
Basic Filtering
Filter resources by field values using query parameters:string
Filter by exact field value
Field Lookups
Use Django-style field lookups for advanced filtering:Exact Match
Contains
Starts With / Ends With
Comparisons
In List
Null / Not Null
Boolean Fields
Date/Time Filtering
Search
Many endpoints support full-text search across multiple fields:string
Search across multiple fields (name, description, etc.)
namedescription- Other relevant text fields
Combining Filters
Combine multiple filters using&:
Ordering
Sort results using theorder_by parameter:
string
Field name(s) to sort by. Prefix with
- for descending orderCommon Ordering Fields
Related Field Filtering
Filter by related object fields using double underscores:Special Filters
Smart Inventory Host Filters
Inventories support complex host filtering:JSON Field Filtering
Filter on JSON fields (variables, extra_vars, etc.):Type Filtering
Filter by resource type in unified endpoints:Examples
Find Failed Jobs from Last Week
Search Job Templates by Name
Find Organizations with Projects
Get Running Jobs
Filter by Multiple Organizations
Find Inventories Without Description
Pagination with Filtering
Filters work seamlessly with pagination:Discovering Filterable Fields
Use OPTIONS to discover filterable fields:- Available filters
- Search fields
- Ordering fields
Filter Performance Tips
Use Indexed Fields
Use Indexed Fields
Filter on indexed fields (id, created, modified, status) for better performance:
Avoid Complex JSON Queries
Avoid Complex JSON Queries
Filtering on deeply nested JSON fields can be slow. Use indexed fields when possible.
Use Specific Filters
Use Specific Filters
Prefer specific filters over broad search terms:
Combine with count_disabled
Combine with count_disabled
When filtering large datasets and iterating, disable counting: