Skip to main content

Overview

This endpoint returns unique values for a specified alert property (field) along with the count of how many times each value appears. It’s useful for creating filter dropdowns, analytics dashboards, and understanding data distribution in your alerts.
Authorization Required: Include a valid Bearer Token in the Authorization header.

Endpoint Details

POST /api/elasticsearch/property/values-with-count

Method: POST
Content-Type: application/json
Authentication: Bearer Token required
Response: Array of value/count objects

Request Body

string
required
The alert property field to analyze (e.g., “status”, “severity”, “dataSource”)
array
Optional filters to apply before analyzing the field values
string
required
Elasticsearch index pattern to search (typically “alert-*”)
integer
default:"10"
Maximum number of unique values to return
boolean
default:"true"
Whether to order results by count (true) or alphabetically (false)
boolean
default:"false"
Sort order: true for ascending, false for descending

JSON Schema


Request & Response Examples

Additional Code Examples


Response Details

Successful Response


Status Codes

OK
Successfully retrieved property values and counts
Bad Request
Invalid field name, malformed filters, or invalid parameters
Unauthorized
Missing or invalid Bearer token
Internal Server Error
Internal server error during analysis

Common Use Cases

Filter Dropdown Population

Analytics Dashboard

Top Offenders Report


Advanced Filtering Examples

Time-based Analysis

Exclude False Positives

Category Analysis


Performance Considerations

Performance Tips:
  • Use appropriate top limits to avoid large result sets
  • Apply filters to reduce the data set being analyzed
  • Consider caching results for frequently requested fields
  • Use specific time ranges rather than analyzing all historical data
  • Monitor query performance for fields with high cardinality

Best Practices

Commonly analyzed fields:
  • severity - Alert severity levels
  • status - Alert status distribution
  • dataSource - Top alert sources
  • category - Alert categories
  • tactic - MITRE ATT&CK tactics
  • tags - Applied tags
Effective filtering:
  • Always include time filters to limit scope
  • Exclude false positives for meaningful analysis
  • Filter by status to focus on actionable alerts
  • Use severity filters for priority analysis
Appropriate limits:
  • Dropdowns: 10-20 items
  • Dashboard charts: 5-15 items
  • Reports: 20-50 items
  • Avoid requesting more than 100 items

OpenAPI Specification