Skip to content

Querying Coralogix with SQL

The Coralogix JDBC driver allows you to investigate your log data using SQL queries with your favorite database tool. With the Coralogix JDBC driver, you can quickly perform SQL queries against the data already stored in your Coralogix account.

Java Database Connectivity (JDBC) is a common standard for database drivers, and many popular querying tools support it. In this tutorial, you'll find instructions on using the Coralogix JDBC driver with the popular tools DataGrip, DBeaver, and Tableau.

Getting started

Follow these steps to set up the connection to Coralogix:

  1. Download the latest driver.

  2. Follow the steps below for client-specific instructions. Other clients should have a similar procedure for installing the driver.

  3. Test the connection using a simple query: SELECT * FROM logs LIMIT 5

DataGrip

  1. Click on + icon in the Database menu and choose Driver

  2. Into Name field write Coralogix

  3. Click on + under Driver Files and pick the driver file you downloaded earlier (Getting Started step #1 above)

  4. Open Class picker and pick org.opensearch.jdbc.Driver

  5. Click on Apply then OK

  6. Click on + icon in the database menu -> choose Data Source -> choose Coralogix

  7. Copy your apiKey from Data Flow -> API Keys -> Logs Query Key in the Coralogix UI and replace <Logs Query Key> with this value in the JDBC URL below as per your Team's cluster location.

  8. In the General tab, change the URL as follows:jdbc:opensearch://<SQLendpoint>/<Logs Query Key>. Select the SQL endpoint associated with your Coralogix domain. To access your Logs Query Key, navigate to Data Flow > API Keys in your Coralogix toolbar.

  9. Click on Apply and OK.

DBeaver

  1. In the top menu select Database -> Driver manager and click the New button

  2. In Driver Name field, enter Coralogix.

  3. In the Libraries tab, click Add File button and pick the driver file you downloaded earlier (Getting Started step #1 above)

  4. Click the Find Class button. Select the org.opensearch.jdbc.Driver in the Driver Class field.

  5. Click OK.

  6. Click Close.

  7. Click Database/New Database Connection. Make sure that All is selected.

  8. Type coralogix into the search box and choose Coralogix driver. Click Next.

  9. Copy your apiKey from Data Flow > API Keys > Logs Query Key in the Coralogix UI and replace <Logs Query Key> with this value in the JDBC URL below as per your Coralogix domain.

  10. Set JDBC URL to jdbc:opensearch://<SQLendpoint>/<Logs Query Key>. Select the SQL endpoint associated with your Coralogix domain.

  11. Click Test Connection to ensure it all works.

  12. Click OK.

Tableau

  1. Download the cx_sql_jdbc.taco connector file, and copy it to: Windows: C:\\Users\\%USERNAME%\\Documents\\My Tableau Repository\\Connectors MacOS: ~/Documents/My Tableau Repository/Connectors

  2. Place the OpenSearch JDBC driver (jar file) downloaded earlier (Getting Started step #1 above) into: Windows: C:\\Program Files\\Tableau\\Drivers MacOS: ~/Library/Tableau/Drivers

  3. Run the Tableau Desktop with the command line flag DDisableVerifyConnectorPluginSignature=true: Windows: C:\\Program Files\\Tableau\\Tableau 2022.1\\bin\\tableau.exe" -DDisableVerifyConnectorPluginSignature=true MacOS: open -n /Applications/Tableau\\ Desktop\\ 2022.1.app --args -DDisableVerifyConnectorPluginSignature=true
    Adjust the command line according to the Tableau version you have. You can create a shortcut or a script to simplify the above step).

  4. Copy your apiKey from Data Flow -> API Keys -> Logs Query Key in the Coralogix UI and replace <Logs Query Key> with this value in the JDBC URL below as per your Team's cluster location.

  5. Open Tableau, and select to a Server > Coralogix by Coralogix.

  6. Set the JDBC URL to: jdbc:opensearch://<SQLendpoint>/<Logs Query Key>. Select the SQL endpoint associated with your Coralogix domain.

Additional resources

APIDirect Archive Query HTTP API
ExternalOpenDistro SQL
Refer to this documentation for further references on supported SQL features.

Support

Need help?

Our world-class customer success team is available 24/7 to walk you through your setup and answer any questions that may come up.

Feel free to reach out to us via our in-app chat or by sending us an email at [email protected].