Adding a XML Source

<< Click to Display Table of Contents >>

Navigation:  Using StreamLab > StreamLab Sources Overview >

Adding a XML Source

Previous pageReturn to chapter overviewNext page

StreamLab lets you access data in XML (eXtensible Markup Language) format over the file system, network socket, AMQP, or Kafka. In creating this source, you configure how StreamLab reads data from the XML source.

To add a XML source:

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

The Edit XML Source page opens.

3.By default, StreamLab uses the project schema for the new source. You can also select a schema from the pulldown menu on the left.

sl_add_stream_source_sel_schema

4.Select a stream from the pulldown menu on the right. This is the stream into which lines from the XML 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 XML 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.Enter an xpath prefix for the XML file, such as /stream/row. You can use this prefix to limit the XML nodes read to a specific namespace.
8.Next, fill in the list of columns, their Xpaths, and their SQL types.

Examples include

column

xpath

type

Store ID

//Body/tri:RetailTransaction/RetailStoreID'

DECIMAL

Workstation_ID

/POSLog/Body/tri:RetailTransaction/WorkstationID'

DECIMAL

You can use the Clipboard to copy column names and types from another form.

9.Test the source by clicking the Sample 5 Rows from Source button.
10.Click the Go Up arrow to exit the Edit Source page.

  sl_go_up_arrow

11.To parse the newly added source, add a guide using the newly added Line source.