WSO2 Complex Event Processor is succeeded by WSO2 Stream Processor. To view the latest documentation for WSO2 SP, see WSO2 Stream Processor Documentation.
Skip to end of metadata
Go to start of metadata


This sample demonstrates how to filter WSO2 events and custom text events and output them to multiple streams. Custom events are events with custom mappings that does not adhere to the default event formats. For more information on event formats, see Event Formats

The execution plan used in this sample is as follows,

from ServerLogs[meta_tenantId != -1234]
select meta_timestamp, meta_tenantId, className, logType
insert into TenantLogs;

from ServerLogs[logType=='WARN' or logType=='warn']
select meta_timestamp, meta_tenantId, className, msg
insert into WarnTypeLogStream;

The first query,

  • Receives events through the serverLogStream.

  • Filter based on the tenant id and inserts tenant into TenantLogs.

The second query,

  • Receives events through the serverLogStream.

  • Filter based on logType and inserts only WARN logs into WarnTypeLogStream.


Set up the prerequisites required for all samples.

Building the sample

Start the WSO2 CEP server with the sample configuration numbered 0117. For instructions, see Starting sample CEP configurations. This sample configuration does the following:

  • Points the default Axis2 repo to the <CEP_HOME>/samples/cep/artifacts/0117 directory (by default, the Axis2 repo is <CEP_HOME>/repository/deployment/server).

Executing the sample

  1. Log into the CEP management console which is located at https://localhost:9443/carbon. Confirm that all the artifacts are deployed properly. 

  2. Log out and enter incorrect credentials to log into the CEP management console. This will generate a WARN log entry.

  3. See the output events received from the CEP console. This sample uses the logger adaptor to log output events to the console.

  • No labels