Adding a CSV Source

<< Click to Display Table of Contents >>

Navigation:  Using StreamLab > StreamLab Sources Overview >

Adding a CSV Source

Previous pageReturn to chapter overviewNext page

StreamLab lets you access files in CSV (Comma Separated Value) format over the file system, network socket, AMQP, or Kafka.

To add a CSV source:

1.On the Sources page, drag a CSV source from the left column into the center area.
2.Click the new CSV source.

The Edit CSV Source page opens.

3.Select a schema from the pulldown menu on the left.


4.Select a stream from the pulldown menu on the right. This is the stream into which lines from the CSV source will be read.
5.Select File System, Socket, AMQP 0.9.1, AMQP 1.0, or Kafka.
6.Next, enter configuration information for the connection. These change depending on your choice of access. See Configuring Line, CSV, XML, and JSON Sources. For example, for file system, enter the following:

Directory. The file system path to the CSV file, such as /var/log/file.CSV

File Pattern. Java Regular Expression used to identify the file. Test the source by clicking the Sample 5 Rows from Source button.

7.Next, fill in the list of columns and their SQL types. You can use the Clipboard to copy column names and types from another form.
8.Test the source by clicking the Sample 5 Rows from Source button.
9.Click the Go Up arrow to exit the Edit Source page.