CREATE ERROR STREAM Statement

Create a stream that collects errors and the events that caused them.

Syntax

CREATE [LOCAL|OUTPUT] ERROR STREAM name ON source [, source ... ]

name is a string that identifies the newly created error stream.

source is a string that identifies a previously defined stream or window.

Usage

Error streams collect error data from the specified streams. Each error record includes the error code and the input event that caused the error. You can simply display these records for monitoring purposes, or they may trigger more processing logic downstream, just like the records from other streams.

In production environments, error streams are used for real-time monitoring of one or more streams in the project. They are also used in development environments to monitor the input and derived streams when debugging a project.

The visibility of an error stream is, by default, LOCAL. To make the error stream visible to external monitoring tools or devices, you must specify OUTPUT when you create it.

You can define more than one error stream in a single project.

Examples

To create a single error stream (that is visible externally) to monitor all the streams in a project with one input stream and two derived streams, enter:
CREATE OUTPUT ERROR STREAM AllErrors ON InputStream, DerivedStream1, DerivedStream2
To create separate error streams (both visible only locally) to monitor the input and derived streams in a project with two input streams and three derived streams, enter:
CREATE ERROR STREAM InputErrors ON InputStream1, InputStream2
CREATE ERROR STREAM QueryErrors ON DerivedStream1, DerivedStream2, DerivedStream3