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.
Note
This API can be used to query high tier data only.
Getting started
Follow these steps to set up the connection to Coralogix:
Download the latest driver.
To use this API you need to create a personal or team API key. It’s recommended to use permission presets, as they are automatically updated with all relevant permissions. Alternatively, you can manually add individual permissions.
Preset Action Description DataQuerying LEGACY-ARCHIVE-QUERIES:EXECUTE
LOGS.DATA-API#HIGH:READDATA
METRICS.DATA-API#HIGH:READDATA
SPANS.DATA-API#HIGH:READDATAQuery Data from the Archive
Query Frequent Search Logs
Query Metrics
Query Frequent Search SpansFollow the steps below for client-specific instructions. Other clients should have a similar procedure for installing the driver.
Test the connection using a simple query:
SELECT * FROM logs LIMIT 5
DataGrip
Click on
+icon in the Database menu and chooseDriverInto
Namefield writeCoralogixClick on
+underDriver Filesand pick the driver file you downloaded earlier (Getting Started step #1 above)Open
Classpicker and pickorg.opensearch.jdbc.DriverClick on
ApplythenOKClick on
+icon in the database menu -> chooseData Source-> chooseCoralogixReplace
<cx_api_key>with the generated API key value in the JDBC URL below as per your Team's cluster location.In the
Generaltab, change the URL as follows:jdbc:opensearch://<sql_endpoint>/<cx_api_key>. Select the SQL endpoint associated with your Coralogix domain.Click on
ApplyandOK.
DBeaver
In the top menu select
Database->Driver managerand click theNewbuttonIn
Driver Namefield, enterCoralogix.In the Libraries tab, click
Add Filebutton and pick the driver file you downloaded earlier (Getting Started step #1 above)Click the
Find Classbutton. Select theorg.opensearch.jdbc.Driverin theDriver Classfield.Click
OK.Click
Close.Click
Database/New Database Connection. Make sure that All is selected.Type
coralogixinto the search box and chooseCoralogixdriver. ClickNext.Replace
<cx_api_key>with the generated API key value in the JDBC URL below as per your Coralogix domain.Set
JDBC URLtojdbc:opensearch://<sql_endpoint>/<cx_api_key>. Select the SQL endpoint associated with your Coralogix domain.Click Test Connection to ensure it all works.
Click
OK.
Tableau
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
- Windows:
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
- Windows:
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.
- Windows:
Replace
<cx_api_key>with the generated API key value in the JDBC URL below as per your Team's cluster location.Open Tableau, and select to a Server > Coralogix by Coralogix.
Set the
JDBC URLto:jdbc:opensearch://<sql_endpoint>/<cx_api_key>. Select the SQL endpoint associated with your Coralogix domain.
Additional resources
| API | Direct Lucene & DataPrime Query HTTP API |
| External | OpenDistro SQL |
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 support@coralogix.com.