Assert
Assert (assert)
Validate an event against a JSON Schema, based on IETF’s draft v7 (http://json-schema.org).
Validation json
Minimal example
actions: - assert: behaviour: no-warnings: drop-onfailure schema: schema-file: ""JSON
{ "actions": [ { "assert": { "behaviour": { "no-warnings": "drop-onfailure" }, "schema": { "schema-file": "" } } } ]}Contents
Fields
| Field | Type | Required | Description |
|---|---|---|---|
schema | Schema | ✅ | The JSON schema to validate an event against. |
behaviour | Behaviour | ✅ | What the job should do if it encounters a schema violation. |
description | string | describe this step. | |
condition | lua-expression (string) | Only run this action if the specified condition is met. Examples: 2 * count() | |
suppress-warnings | boolean (bool) | Suppress warnings generated by this action. |
Schema
Schema Options
| 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. |
Behaviour Options
| 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. |
abort-on-failure | Abort On Failure | bool | Abort the job. |
Behaviour - No Warnings Options
| Value | Description |
|---|---|
drop-onfailure | Drop Onfailure |
abort-on-failure | Abort On Failure |