Overview
This endpoint retrieves alerts from UTMStack’s Elasticsearch index. It supports advanced filtering, pagination, and sorting, allowing analysts to query alerts within specific time ranges or by defined conditions.Authorization Required: All requests must include a valid Bearer Token obtained from the authentication endpoint.
Endpoint Details
POST /api/elasticsearch/search
Method: POST
Content-Type: application/json
Authentication: Bearer Token required
Response: Array of alert objects
Content-Type: application/json
Authentication: Bearer Token required
Response: Array of alert objects
Query Parameters
Current page number (starts at 1)
Number of results per page (e.g., 25)
Maximum number of records to retrieve (e.g., 100000000)
Elasticsearch index pattern (e.g.,
alert-*
)Sorting field and direction (e.g.,
@timestamp,desc
)Request Body
The request body is a JSON array of filter definitions used to refine the search.Filter Structure
Name of the alert field to filter (e.g., “status”, “tags”, “@timestamp”)
Filter operator:
IS
, IS_NOT
, IS_BETWEEN
, CONTAINS
, etc.Filter value (string, number, or array for range operations)
Example Filter Payload
Request & Response Examples
Additional Code Examples
Response Details
Returns a JSON array of alert objects. Each alert includes metadata, source/destination information, and contextual details.Complete Response Structure
- Success Response
- Empty Response
- Error Response
Response Fields
Alert severity level (1-5, where 5 is highest)
Human-readable severity label (Low, Medium, High, Critical)
Alert status code (1=Ignored, 2=Open, 3=In Review, 5=Completed)
Human-readable status label
Alert rule name or title
Detailed description of the security event
Recommended remediation steps
MITRE ATT&CK tactic classification
Alert category classification
Source system that generated the alert
ISO 8601 timestamp when the alert was created
Filter Operators
Basic Operators
Basic Operators
- IS: Exact match
- IS_NOT: Not equal to
- CONTAINS: Contains substring
- STARTS_WITH: Begins with value
- ENDS_WITH: Ends with value
Numeric Operators
Numeric Operators
- GREATER_THAN: Greater than value
- LESS_THAN: Less than value
- GREATER_EQUAL: Greater than or equal to
- LESS_EQUAL: Less than or equal to
Range Operators
Range Operators
- IS_BETWEEN: Between two values (requires array)
- IS_IN: Value in list (requires array)
- IS_NOT_IN: Value not in list (requires array)
Common Filter Examples
Filter by Severity
Filter by Time Range (Last 24 hours)
Filter by Multiple Statuses
Filter by Data Source
Status Codes
Search completed successfully. Returns array of alerts.
Invalid request parameters or malformed filter syntax.
Missing or invalid Bearer token.
Insufficient permissions to access alerts.
Elasticsearch service error or internal server issue.
Pagination
The API supports pagination through thepage
and size
parameters:
- page: Current page number (1-based)
- size: Number of results per page
- top: Maximum total results to consider
For optimal performance, use reasonable
size
values (25-100) and implement client-side pagination for large result sets.Performance Considerations
Performance Tips:
- Use specific time ranges to limit search scope
- Apply filters to reduce the result set size
- Avoid very large
top
values unless necessary - Consider using field-specific filters for better query performance