Write
The Write Stage writes events to an existing Output.
Target
Use the reference panel to define the list of Outputs you want the stage to write.
Success / Failure
The Write Stage provides alternative paths for successful and failed writes. This allows for pipelines to have special handling for write failures.
A failed write occurs if any target fails to write, and a single event is sent to the Failure path. The event includes the original event being written, as well as a “writeErrors” metadata value that contains the status of each write. The metadata looks as follows:
[{ // order matches the order of the target reference list
reference: string // the target reference name
quality: string // good or bad for success/failure
reason: string // the error message for the failed write
}]
If the Failure path is not connected, the stage produces an error. Below is an example of a pipeline write error taking the failure path. Note the warning is only shown in replay mode.
If all targets successfully write, the event takes the Success path.
Custom Failure Handling
To perform error handling and then force an error in the pipeline, use a transform stage and throw an exception using code like the following.
throw("some error message")