Skip to content

Assert

Validate an event against a JSON Schema, based on IETF’s draft v7 (http://json-schema.org).

Validation json

actions:
- assert:
behaviour:
no-warnings: drop-onfailure
schema:
schema-file: ""
JSON
{
"actions": [
{
"assert": {
"behaviour": {
"no-warnings": "drop-onfailure"
},
"schema": {
"schema-file": ""
}
}
}
]
}

A ✓ marks a field that accepts a context variable such as {{ VARIABLE }}.

Field Type Required Description
description string describe this step.
condition lua-expression (string) Only run this action if the specified condition is met.
Examples: 2 * count()
schema Schema The JSON schema to validate an event against.
Allowed values: schema-file, schema-string, checks
behaviour Behaviour What the job should do if it encounters a schema violation.
Allowed values: no-warnings, drop-onfailure, abort-on-failure
suppress-warnings boolean (bool) Suppress warnings generated by this action.
Default: false
Option Name Type Description
schema-file Schema File string File containing JSON schema.
Examples: /path/to/file, c:\users\joe\data\file.txt
schema-string Schema String string JSON schema as text.
checks Checks object Structured assertion checks (number/date/time/in-set).
Option Name Type Description
no-warnings No Warnings symbol Switch off warnings.
Allowed values: drop-onfailure, abort-on-failure
drop-onfailure Drop Onfailure bool Just Drop the Event.
Default: false
abort-on-failure Abort On Failure bool Abort the job.
Default: false
Field Type Required Description
name string Optional check identifier used in annotations.
kind Kind Check kind.
Allowed values: number, date, time, in-set
field string Source field for this check.
required boolean (bool) Whether the field is required.
Default: false
code string Optional custom failure code.
allow-decimal boolean (bool) Number check option: allow decimal values.
Default: true
allow-negative boolean (bool) Number check option: allow negative values.
Default: false
format string Date/time format hint (currently YYYY/MM/DD or HH:MM).
values string[] In-set check option: allowed values.
case-insensitive boolean (bool) In-set check option: case-insensitive matching.
Default: false
Field Type Required Description
annotation-field field (string) Field receiving per-check annotations (defaults to _assert).
Examples: data_field
ok-field field (string) Field receiving overall success (true when all checks pass).
Examples: data_field
issues-field field (string) Field receiving ordered failure codes.
Examples: data_field
Field Type Required Description
checks Checks[] Ordered list of checks to evaluate.
output Output Optional output field configuration for check annotations.
Value Aliases Name Description
number number
date date
time time
in-set in-set
Value Aliases Name Description
drop-onfailure drop-onfailure
abort-on-failure abort-on-failure