Simple ETL
Description
The flow shown below is an example of data injection. After having transformed our data passing through an external web service (RandomUser.me) and several components which act as data formatting, the data will be written into and read from a Devo table. Then, a second sub-flow will get the data from the injected table, configure it, and send the results via Slack.
Flow configuration
As you can see in the picture above, this flow is composed by 2 different sets of units: a main flow that gets the data, configures it, and injects it into a Devo table, and a sub-flow that will read the data and send it to a specified Slack channel.
The following table describes the units needed to create the main flow, as well as how to configure and link them.
Unit type and description | Configuration |
---|---|
Tick This unit will send an event each time we click it, which will call an external web service added in the next unit. | Drag a Tick unit to the canvas and open its configuration options by double-clicking it. In the General tab, simply add a name to the unit (in this example, we called it callService). We don't need to add anything in the Fields tab since we only need to call a request to the external web service added in the following unit upon demand, that is to say, when clicking this unit. Click Apply to save the configuration. |
HttpCall This unit will call a request to the RandomUser API each time we click the Tick unit added. A list of random users will be added to the response column that will be added to the events. | Drag a HttpCall unit to the canvas and link the output port of the Tick unit to the input port of this unit. Then, open the configuration options of the unit by double-clicking it and enter the following values in the General tab:
Click Apply to save the configuration. |
JsonParser This unit will parse the response string generated by the RandomUser API and transform it into a JSON object. | Drag a JsonParser unit to the canvas and link the output port out of the HttpCall unit to the input port of this unit. Then, open the configuration options of the unit by double-clicking it and enter the following values:
Click Apply to save the configuration. |
Map This unit will extract the required information from the received JSON objects. | Drag a Map unit to the canvas and link the output port out of the JsonParser unit to the input port of this unit. Then, open the configuration options of the unit by double-clicking it. In the General tab, simply add a name to the unit (in this example, we called it getFields). Now go to the Fields to add tab. Click the + icon in the fields section to add 8 new columns to the events sent: Column 1This column extracts all the info from the JSON object. Fro there, we will start extracting the required parts.
data.get("results").get(0) Column 2This column extracts the name from the JSON object.
all.get("name").get("first") Column 3This column extracts the surname from the JSON object.
all.get("name").get("last") Column 4This column extracts the gender from the JSON object.
Column 5This column extracts the email from the JSON object.
Column 6This column extracts the location from the JSON object.
Column 7This column extracts the city from the JSON object.
Column 8This column extracts the country from the JSON object.
Click Apply to save the configuration. |
Map This unit will delete the fields that we don't need from the received events. | Drag another Filter unit to the canvas and link the output port out of the previously added Filter unit to the input port of this unit. Then, open the configuration options of the unit by double-clicking it. In the General tab, simply add a name to the unit (in this example, we called it removeGenericFields). Now go to the Fields to remove tab. Click the Fields field to expand a dropdown menu that contains all the columns in your events. In this case, we will select these ones in order to remove them: response, data, all and location. Click Apply to save the configuration. |
DevoSink This unit will inject the received data to a Devo my.app table. | Drag a DevoSink unit to the canvas and link the output port out of the second Filter unit to the input port of this unit. Then, open the configuration options of the unit by double-clicking. Enter a Name for the unit (in this example, we called it sendToDevo) and the Table name where you want to send the data. Note that the table you choose must be a my.app table. This works as Devo injections, which can only be done in my.app tables. Learn more in Inject data to a new table. Click Apply to save the configuration. |
Now that we have created a Flow to send data to the specified my.app table, we will create another one that will read the data in that table, format it and send it to a specified Slack channel.
Uni type and description | Configuration |
---|---|
DevoSource
This unit will read the data from the my.app table where we injected the events. | Drag a DevoSource unit to the canvas and open its configuration options by double-clicking it. Enter a Name for the unit (in this example, readFromDevo)and check off for the Check DB configuration field. In the Query field, enter the query from which you want to get data. In this example, we will use the following: Also, you can optionally choose a Start time for the query. Click Apply to save the configuration. |
Map We will use this unit to get the information we want to send through Slack and format it as required. | Drag a Map unit to the canvas and link the output port data of the DevoSource unit to the input port of this unit. Then, open the configuration options of the unit by double-clicking it. In the General tab, simply add a name to the unit (in this example, we called it messageToEvent). Now go to the Fields to add tab. Click the + icon in the fields section to add 6 new columns to the events sent, including the required format we will use to send the messages through Slack: Column 1
Column 2
Column 3
Column 4
Column 5
Column 6
Click Apply to save the configuration. |
SlackSink The Slack Sink unit sends a Slack message to a configurable channel. | Drag a SlackSink unit to the canvas and link the output port out of the Map unit to the input port of this unit. Then, open the configuration options of the unit by double-clicking it and enter the following information:
Click Apply to save the configuration. |
Result
Once you have defined the whole Flow, click the Start button to activate it and click the first unit (Tick). If everything is correctly configured, the Slack channel specified in the SlackSink unit through the corresponding Webhook will receive a notification indicating the user info for generated in the my.app table indicated.
This is how the Slack message looks like:
Import this Flow
Download this Flow in JSON format and import it to your domain using the Import option:
Add the required data to make this Flow work
As explained in the Simple ETL configuration section, you must include the my.app table where you want to inject the data and then read it in the DevoSink and DevoSource units to make this flow work. Also, you must indicate the required Slack Webhook in the SlackSink unit.