Prerequisites
- Coralogix account with DataPrime query access
- Logs API key
Setup
Option 1: Interactive CLI
Option 2: Environment variables
Add to your.env:
| Variable | Default | Description |
|---|---|---|
CORALOGIX_API_KEY | — | Required. Coralogix Logs Query API key |
CORALOGIX_API_URL | https://api.coralogix.com | Endpoint for your Coralogix cluster |
CORALOGIX_APPLICATION_NAME | — | Filter queries to this application |
CORALOGIX_SUBSYSTEM_NAME | — | Filter queries to this subsystem |
Option 3: Persistent store
Cluster endpoints
| Region | API URL |
|---|---|
| US1 | https://api.coralogix.com |
| EU1 | https://api.eu1.coralogix.com |
| EU2 | https://api.eu2.coralogix.com |
| AP1 | https://api.ap1.coralogix.com |
| AP2 | https://api.ap2.coralogix.com |
Creating an API key
- In Coralogix, go to Data Flow → API Keys
- Click + New API Key
- Select Logs Query as the key type
- Copy the key
Verify
Troubleshooting
| Symptom | Fix |
|---|---|
| 401 Unauthorized | Check the API key and ensure it’s a Logs Query key |
| Connection timeout | Verify CORALOGIX_API_URL matches your cluster region |
| No results | Confirm CORALOGIX_APPLICATION_NAME and CORALOGIX_SUBSYSTEM_NAME match your data |
Security best practices
- Use a read-only Logs Query key — avoid admin or send-data keys.
- Store the API key in
.env, not in source code.