This documentation is for WSO2 CEP 3.1.0. View the home page of the latest release.

Unknown macro: {next_previous_links}
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Introduction

This sample demonstrates how to process server logs (Tested for Carbon servers). Here we have used file input adaptor and logger output adaptor.

The query used in this sample is as follows: Here we are checking for warnings logs and emitting events based on that and print as a log info (and console).

from serverLogStream[logType=='INFO' or logType=='info']
select *
insert into infoTypeLogStream;
from serverLogStream[logType=='WARN' or logType=='warn']
select *
insert into warnTypeLogStream;

Prerequisites

  1. See Prerequisites in CEP Samples Setup page.

Building the sample

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

  • Creates <CEP_HOME>/repository/conf/data-bridge/stream-definitions.xml file, which is used to create the stream definitions for the sample.

Executing the sample

  1. First, after server restart go to the corresponding event builder and point the log file to correct location. Please note here server will only reads the tail logs, not full logs.

  2. Then, if CEP detects any warn logs then it will emit events as shown below. (using logger event adaptor) 

  • No labels