Function: Assert

Overview

Assert the function result

181

Description

This function is a test function. The main purpose of the function is to check the value of fields after some actions. The function accepts events as input, and outputs the result of comparing the specified and current field values in the form { 'Some operation': 'success' }
The function parameters allow you to specify the operation name, the field whose value will be compared, the assert type, and the expected value.
Assert type is one of: Equals, Not equals, True, False, Exist, Not exist

Function Schema

797

Example

Using this function, you can check whether the 'timestamp' field is present in the event. You can add the 'timestamp' field using the 'Add Date & Time' function. In the function parameters, set Operation Name= 'Assert timestamp exists', Field Name= 'timestamp', Assert Type='Exists'. If this field is present, the function outputs an event containing the field name and the function result: { 'Some operation': 'success' }

751