Connections to Elasticsearch are made in QuerySurge using the Elasticsearch JDBC driver. QuerySurge can take advantage of the power and connectivity options of Elasticsearch by setting up a regular JDBC connection to your Elasticsearch Deployment. You can download the Elasticsearch JDBC driver here.
Create a Connection
To create an Elasticsearch connection in QuerySurge, use the Connection Extensibility feature of the Connection Wizard. The key pieces of information that you'll need for your connection include:
- The Elasticsearch user credentials (username and password)
- The Elasticsearch JDBC driver class:
- The Elasticsearch hostname
- The Elasticsearch port (default is 9243)
- The Elasticsearch JDBC Connection URL (using the hostname and port):
Elasticsearch JDBC parameters are described here.
Setting up a Connection with the Elasticsearch JDBC Driver
- Download the Elasticsearch JDBC driver. The driver download can be found here.
- Deploy the driver jar to your QuerySurge Agent(s). The procedure for deploying a driver to a QuerySurge Agent is here (for Agents on Windows) and here (for Agents on Linux).
- Log into QuerySurge as a QuerySurge Admin user, and navigate to the Admin view. Launch the Connection Wizard, give your Connection a name, and for the Data Source, choose the Connection Extensibility option. (Steps for using the Connection Extensibility feature can be found here.). Click Next.
- Enter the Elasticsearch driver class (org.elasticsearch.xpack.sql.jdbc.EsDriver). Click Next.
- Enter your Elasticsearch JDBC URL (see above). Enter the Elasticsearch username and password in the Authentication Info section. Click Next. When you've entered your URL, the Connection Wizard will look like the following. After verifying your entries, click Next.
Note: The parameter
validate.properties=falseis required with this connection to work with QuerySurge.
Note: A test query (optional) need only return a single row/column.
- If you have entered a test Query, you can use it to verify that your Connection parameters are correct by clicking the Test Connection button.
Note: The table name for the data is found in Kibana > Stack Management > Data Views
- The Connection test gives a popup showing whether the Connection was successfully completed.
- Once you have verified your Connection information, click the Save button to save the Connection. You are now ready to use the Connection in a QueryPair.