Connecting Tableau with Open Distro for Elasticsearch
Download and Installation
- Download and install Tableau Desktop.
- Install and configure Open Distro for Elasticsearch.
- Download the Open Distro for ElasticSearch JDBC Driver.
Setup
Specify the JDBC driver
Place the opendistro-sql-jdbc-x.x.x.x.jar file in the folder for your operating system. (Create the folder if it doesn't already exist.)
| Platform | Driver Path |
|---|---|
| Windows | C:\Program Files\Tableau\Drivers |
| Mac | ~/Library/Tableau/Drivers |
| Linux | /opt/tableau/tableau_driver/jdbc |
Create TDC file
TDC file is required to add customization for the data connection. For reference, see the following sample elasticsearch.tdc file.
<?xml version='1.0' encoding='utf-16' ?>
<connection-customization class='genericjdbc' enabled='true' version='2019.3'>
<vendor name='genericjdbc' />
<driver name='elasticsearch' />
<customizations>
<customization name='CAP_CREATE_TEMP_TABLES' value='no'/>
<customization name='CAP_SUPPRESS_DISCOVERY_QUERIES' value='yes' />
<customization name='CAP_SUPPRESS_DISPLAY_LIMITATIONS' value='yes'/>
<customization name='CAP_JDBC_SUPPRESS_ENUMERATE_DATABASES' value='yes' />
<customization name='CAP_JDBC_SUPPRESS_ENUMERATE_SCHEMAS' value='yes' />
<customization name='CAP_JDBC_SUPPRESS_EMPTY_CATALOG_NAME' value='yes' />
<customization name='CAP_JDBC_METADATA_READ_PRIMARYKEYS' value='no'/>
<customization name='CAP_QUERY_SUBQUERIES_WITH_TOP' value='yes'/>
</customizations>
</connection-customization>
- Using a text editor, add
<connection-customization>section. - Name the file
elasticsearch.tdcand save it toMy Tableau Repository\Datasources. - Restart Tableau to apply the change.
For futher details check using a .tdc file with Tableau
Connection information
You will need:
-
JDBC connection string to enter in the URL field when you connect.
Sample connection string for connecting to localhost:
jdbc:elasticsearch://localhost:9200. -
Credentials for signing in to the server (user name and password).
-
(Optional) JDBC properties file to customize the driver behavior. For more details check Customize JDBC Connections Using a Properties File
- Create a properties file called
elasticsearch.properties. - Save the file to the
My Tableau Repository\Datasourcesdirectory.
- Create a properties file called
Make the connection
- Start Tableau and under Connect, select Other Databases (JDBC). If not visible, select More under To a Server to find it in the list.
- Enter the JDBC connection string in the URL field.
- Select the Dialect as MySQL from the drop-down list.
- Enter the user name and password for signing into the server.
- (Optional) Browse to the JDBC properties file.
- Select Sign in
Prepare data
- Select a single table by double-clicking or dragging the required table to the canvas.
- To add data from two or more tables:
- Double click or drag tables to canvas.
- Select the desired type of join operation. Tableau supports inner join, right join, left join and full outer join.
- Select columns for join. (For meaningful result, type of column should be the same.)
Build charts and analyze data
- Select Sheet 1 on the bottom left corner.
- Double click or drag desired fields under Measure.
- Double click or drag desired fields under Dimensions.
- Select available visualization under Show Me.