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:
Download the latest driver.
Follow 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 chooseDriver
Into
Name
field writeCoralogix
Click on
+
underDriver Files
and pick the driver file you downloaded earlier (Getting Started step #1 above)Open
Class
picker and pickorg.opensearch.jdbc.Driver
Click on
Apply
thenOK
Click on
+
icon in the database menu -> chooseData Source
-> chooseCoralogix
Copy your
apiKey
fromData 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.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 yourLogs Query Key
, navigate to Data Flow > API Keys in your Coralogix toolbar.Click on
Apply
andOK
.
DBeaver
In the top menu select
Database
->Driver manager
and click theNew
buttonIn
Driver Name
field, enterCoralogix
.In the Libraries tab, click
Add File
button and pick the driver file you downloaded earlier (Getting Started step #1 above)Click the
Find Class
button. Select theorg.opensearch.jdbc.Driver
in theDriver Class
field.Click
OK
.Click
Close
.Click
Database/New Database Connection
. Make sure that All is selected.Type
coralogix
into the search box and chooseCoralogix
driver. ClickNext
.Copy your
apiKey
fromData 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.Set
JDBC URL
tojdbc:opensearch://<SQLendpoint>/<Logs Query 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
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
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).Copy your
apiKey
fromData 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.Open Tableau, and select to a Server > Coralogix by Coralogix.
Set the
JDBC URL
to:jdbc:opensearch://<SQLendpoint>/<Logs Query Key>
. Select the SQL endpoint associated with your Coralogix domain.
Additional resources
API | Direct Archive Query HTTP API |
External | OpenDistro 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].