Skip to content

Evaluation Criteria Reference

  1. Overview
  2. JSONPath Expression Syntax
  3. Data Types
  4. Operators
  5. Array Match Modes
  6. Complete Examples
  7. Best Practices

The governance service evaluation engine provides a powerful and flexible system for evaluating compliance criteria against event data. It uses JSONPath expressions to extract values from JSON data and applies various operators to determine compliance status.

  • JSONPath Expressions: Extract values from JSON event data
  • Data Types: Define how values are interpreted and compared
  • Operators: Specify the comparison logic
  • Array Match Modes: Control how array values are evaluated

The evaluation engine supports a subset of JSONPath syntax optimized for performance and clarity.

SyntaxDescriptionExample
$Root object$ returns entire object
.Child operator$.status
..Recursive descent$..status
[n]Array element at index n$.items[2]
[*]All array elements$.items[*]
[?()]Array filter expression$.items[?(@.type=='x')]
// Event data
{
"status": "active",
"score": 85
}
// JSONPath: $.status
// Returns: "active"
// JSONPath: $.score
// Returns: 85
// Event data
{
"server": {
"status": "running",
"metrics": {
"cpu": 45.5,
"memory": 78.2
}
}
}
// JSONPath: $.server.status
// Returns: "running"
// JSONPath: $.server.metrics.cpu
// Returns: 45.5
// Event data
{
"vulnerabilities": [{ "severity": 3 }, { "severity": 7 }, { "severity": 9 }]
}
// JSONPath: $.vulnerabilities[0].severity
// Returns: 3
// JSONPath: $.vulnerabilities[2].severity
// Returns: 9
// Event data
{
"services": [
{ "name": "api", "status": "healthy" },
{ "name": "db", "status": "unhealthy" },
{ "name": "cache", "status": "healthy" }
]
}
// JSONPath: $.services[*].status
// Returns: ["healthy", "unhealthy", "healthy"]
// JSONPath: $.services[*].name
// Returns: ["api", "db", "cache"]
// Event data
{
"items": [
{ "type": "security", "score": 85 },
{ "type": "performance", "score": 92 },
{ "type": "security", "score": 78 }
]
}
// JSONPath: $.items[?(@.type=='security')].score
// Returns: [85, 78]
  • Root Access: Use $ or . to access the entire object
  • Array Wildcards: Use [*] to read all elements in an array; [] is not a wildcard form
  • Recursive Descent: Use $..fieldName to find matching fields at any depth
  • Filters: Array filters use the ?(...) form and support equality, comparison, regex, and field-existence checks on item fields
  • Missing Fields: Missing values are tracked in the extraction details and cause the criterion to fail instead of raising an extraction error

The evaluation engine supports six data types for criteria values:

Text values compared as strings.

{
"type": "string",
"field": "$.status",
"operator": "eq",
"criteriaValue": "active"
}

Numeric values (integers or decimals) compared as 64-bit floating-point numbers.

{
"type": "number",
"field": "$.score",
"operator": "gt",
"criteriaValue": 80
}

True/false values. Supports various representations:

  • Boolean: true, false
  • String: "true", "false" (case-insensitive)
  • Number: 0 (false), non-zero (true)
{
"type": "boolean",
"field": "$.enabled",
"operator": "eq",
"criteriaValue": true
}

Date/time values in RFC3339 format.

{
"type": "date",
"field": "$.lastUpdated",
"operator": "gt",
"criteriaValue": "2024-01-01T00:00:00Z"
}

Array of string values. Supports multiple input formats:

  • JSON array: ["value1", "value2"]
  • Comma-separated: "value1,value2"
{
"type": "list[string]",
"field": "$.tags",
"operator": "in",
"criteriaValue": ["production", "critical"]
}

Array of numeric values.

{
"type": "list[number]",
"field": "$.scores",
"operator": "in",
"criteriaValue": [80, 90, 100]
}

The evaluation engine supports ten comparison operators:

Checks if values are equal. Supports flexible type comparison.

{
"operator": "eq",
"criteriaValue": "active"
}

Checks if values are not equal.

{
"operator": "neq",
"criteriaValue": "inactive"
}

Numeric comparison - actual value must be greater than criteria value.

{
"operator": "gt",
"criteriaValue": 80
}

Numeric comparison - actual value must be less than criteria value.

{
"operator": "lt",
"criteriaValue": 100
}

Numeric comparison - actual value must be greater than or equal to criteria value.

{
"operator": "gte",
"criteriaValue": 80
}

Numeric comparison - actual value must be less than or equal to criteria value.

{
"operator": "lte",
"criteriaValue": 100
}

Checks if actual value exists in the criteria list.

{
"operator": "in",
"criteriaValue": ["active", "pending", "processing"]
}

Checks if actual value does not exist in the criteria list.

{
"operator": "notIn",
"criteriaValue": ["failed", "error", "timeout"]
}

String comparison - checks if actual string contains the criteria string.

{
"operator": "contains",
"criteriaValue": "error"
}

String comparison - checks if actual string does not contain the criteria string.

{
"operator": "notContains",
"criteriaValue": "warning"
}

When JSONPath expressions return arrays (e.g., using [*]), you can control how the evaluation is performed:

All elements in the array must satisfy the criteria. This is the default for most operators.

{
"field": "$.vulnerabilities[*].severity",
"operator": "lte",
"criteriaValue": 7,
"arrayMatchMode": "all" // Optional - this is the default
}

Example: All vulnerabilities must have severity ≤ 7

At least one element in the array must satisfy the criteria. This is the default for in and contains operators when arrayMatchMode is omitted.

{
"field": "$.backups[*].status",
"operator": "eq",
"criteriaValue": "available",
"arrayMatchMode": "any"
}

Example: At least one backup must be available

{
"evaluationCriteria": [
{
"type": "number",
"field": "$.security_scan.vulnerabilities[*].severity",
"operator": "lte",
"criteriaValue": 7,
"arrayMatchMode": "all"
},
{
"type": "boolean",
"field": "$.security_scan.passed",
"operator": "eq",
"criteriaValue": true
},
{
"type": "string",
"field": "$.security_scan.scanner_version",
"operator": "contains",
"criteriaValue": "v2"
}
]
}
{
"evaluationCriteria": [
{
"type": "string",
"field": "$.services[*].status",
"operator": "eq",
"criteriaValue": "healthy",
"arrayMatchMode": "all"
},
{
"type": "number",
"field": "$.services[*].response_time_ms",
"operator": "lt",
"criteriaValue": 1000,
"arrayMatchMode": "all"
},
{
"type": "string",
"field": "$.monitoring.alerts[*].severity",
"operator": "notIn",
"criteriaValue": ["critical", "high"],
"arrayMatchMode": "all"
}
]
}
{
"evaluationCriteria": [
{
"type": "number",
"field": "$.data_quality.completeness_percent",
"operator": "gte",
"criteriaValue": 95
},
{
"type": "list[string]",
"field": "$.data_quality.validation_errors[*].field",
"operator": "notIn",
"criteriaValue": ["customer_id", "transaction_id", "timestamp"],
"arrayMatchMode": "all"
},
{
"type": "boolean",
"field": "$.data_quality.schema_valid",
"operator": "eq",
"criteriaValue": true
}
]
}
{
"evaluationCriteria": [
{
"type": "string",
"field": "$.regions[*].status",
"operator": "eq",
"criteriaValue": "operational",
"arrayMatchMode": "any" // At least one region operational
},
{
"type": "number",
"field": "$.regions[*].error_rate",
"operator": "lt",
"criteriaValue": 5,
"arrayMatchMode": "all" // All regions must have low error rate
}
]
}
  • Prefer $.server.metrics.cpu over complex filter expressions
  • Use array indices when targeting specific elements
  • Use number for all numeric comparisons
  • Use list[string] for in/notIn operations with multiple values
  • Use boolean for true/false checks
  • Use eq/neq for exact matches
  • Use contains/notContains for substring searches
  • Use in/notIn for membership tests
  • Use all (default) for strict compliance
  • Use any for redundancy or availability checks
  • Missing JSONPath values cause the affected criterion to fail
  • Consider using default values in your event data
  • Test with various data structures
  • Simple paths are faster than wildcard expressions
  • Limit the depth of nested field access
  • Use specific array indices when possible

The evaluation engine performs automatic type conversion when possible:

  • "123"123
  • "45.67"45.67
  • "true"true
  • "false"false
  • Case-insensitive
  • 0false
  • Non-zero → true
  • Single values can match array criteria
  • "value" can match ["value", "other"] with in operator

Common failure modes and their meanings:

Failure modeCauseSolution
Missing extracted valueJSONPath doesn’t match the event payloadVerify path and data structure
Type conversion failedExtracted value cannot be compared as the configured typeEnsure data type matches criteria type
Empty or invalid JSON payloadEvent payload is empty or not valid JSONValidate the event payload before ingestion
Invalid operatorCriterion uses an unsupported operatorUse supported operators only
  1. Test JSONPath expressions separately before creating criteria
  2. Log extracted values to verify correct data extraction
  3. Start simple with basic paths and operators
  4. Validate event data structure matches expected format
  5. Use appropriate match modes for array evaluations