This sample demonstrates how to receive custom messages with common CSV data standard and how to map the values for the specified event stream. 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. Also, there are some of the Regular Expressions that are used to classify the text which is logged by the logger publisher. This sample does not do any processing on the incoming event. The log event publisher is used to log the received events which read from a CSV file using the file tail receiver.
Common RegEx to clarify inputs and outputs in WSO2 CEP
- Receiving the CLI logging as events
- information type:
- class name:
\ } \ s*- \ s*(.*)
- Receiving events from a standard CSV file (data is separated by a comma and events are separated by a new line character)
- first element:
- second element:
- third element:
- first element:
Set up the prerequisites required for all samples
Building the sample
Start the WSO2 CEP server with the sample configuration numbered 0022. For instructions, see Starting sample CEP configurations. This sample configuration creates the following.
- A stream named
- An event receiver named
- An event publisher named
fileLoggerto log the messages.
Executing the sample
Navigate to the
file, and append several lines in similar format as the first line which is already entered.
You can use a command similar to below to add the lines to the fileReceiver.csv. Please do not edit the file directly and save as this will not work when tailing the file.
The file tail receiver reads from the CSV file as it gets updated and the input values mapped by the receiver are logged by the logger.
You view the CEP server receiving the events in the logs of it in the CLI as shown below.