This sample demonstrates how to receive custom messages with common CSV data standard and how to map the values for a specified event stream. Custom events are events with custom mappings that do 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 that 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 that are 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 DAS 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 a format similar to the first line that is already entered.
You can use a command similar to the command given below to add the lines to the
fileReceiver.csv. Do not edit the file directly and save because that does not allow the file to be successfully tailed.
The file tail receiver reads from the CSV file as it gets updated. The input values mapped by the receiver are logged by the logger.
The events received by the DAS server are logged in the CLI as shown below.