Skip to main content

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

Query Parameters

integer
required
Current page number (starts at 1)
integer
required
Number of results per page (e.g., 25)
integer
required
Maximum number of records to retrieve (e.g., 100000000)
string
required
Elasticsearch index pattern (e.g., alert-*)
string
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

string
required
Name of the alert field to filter (e.g., “status”, “tags”, “@timestamp”)
string
required
Filter operator: IS, IS_NOT, IS_BETWEEN, CONTAINS, etc.
any
required
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

Response Fields

integer
Alert severity level (1-5, where 5 is highest)
string
Human-readable severity label (Low, Medium, High, Critical)
integer
Alert status code (1=Ignored, 2=Open, 3=In Review, 5=Completed)
string
Human-readable status label
string
Alert rule name or title
string
Detailed description of the security event
string
Recommended remediation steps
string
MITRE ATT&CK tactic classification
string
Alert category classification
string
Source system that generated the alert
string
ISO 8601 timestamp when the alert was created

Filter Operators

  • IS: Exact match
  • IS_NOT: Not equal to
  • CONTAINS: Contains substring
  • STARTS_WITH: Begins with value
  • ENDS_WITH: Ends with value
  • GREATER_THAN: Greater than value
  • LESS_THAN: Less than value
  • GREATER_EQUAL: Greater than or equal to
  • LESS_EQUAL: Less than or equal to
  • 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

OK
Search completed successfully. Returns array of alerts.
Bad Request
Invalid request parameters or malformed filter syntax.
Unauthorized
Missing or invalid Bearer token.
Forbidden
Insufficient permissions to access alerts.
Internal Server Error
Elasticsearch service error or internal server issue.

Pagination

The API supports pagination through the page 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