This documentation is for WSO2 Complex Event Processor 4.0.0. View documentation for the latest release.
WSO2 Complex Event Processor is succeeded by WSO2 Stream Processor. To view the latest documentation for WSO2 SP, see WSO2 Stream Processor Documentation.

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents


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 serverLogStream[logType=='INFO' or logType=='info'] select * insert into infoTypeLogStream;from serverLogStreamServerLogs[meta_tenantId != -1234]
select meta_timestamp, meta_tenantId, className, logType
insert into TenantLogs;

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

The first query,

  • Receives events through the serverLogStream.

  • Filter based on the logType tenant id and insert inserts tenant into infoTypeLogStreamTenantLogs.

The second query,

  • Receives events through the serverLogStream.

  • Filter the based on logType and insert into warnTypeLogStreaminserts only WARN logs into WarnTypeLogStream.


See Prerequisites in CEP Samples Setup page.


  • Points the default Axis2 repo to <CEP_HOME>/sample/artifacts/0117 (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.

Image Added