Global Validation
Inside the global configuration is a framework that validates all messages coming from all parsers. This is performed using validation plug-ins that make assertions about fields or whole messages.
The format for this framework is a fieldValidations
field inside the
global configuration. This is associated with an array of field validation objects
structured as follows:
- input
An array of input fields or a single field. If this value is omitted, then the whole messages is passed to the validator.
- config
A string-to-object map for validation configuration. This value is optional if the validation function requires no configuration.
- validation
The validation function to be used. This is one of the following:
- STELLAR
Execute a Query Language statement. Expects the query string in the condition field of the configuration.
- IP
Verifies that the input fields are an IP address. By default, if no configuration is set, the value is assumed to be IPV4, but you can specify the type by passing in the type with either IPV6 or IPV4.
- DOMAIN
Validates that the fields are all domains.
Validates that the fields are all email addresses.
- URL
Validates that the fields are all URLs.
- DATE
Validates that the fields compose a date. Expects format in the configuration.
- INTEGER
Validates that the fields compose an integer. String representation of an integer is allowed.
- REGEX_MATCH
Validates that the fields match a regular expression. Expects pattern in the configuration.
- NOT_EMPTY
Validates that the fields exist and are not empty (after trimming).