Prerequisites
- An Elasticsearch cluster with the SQL API enabled
- The Elasticsearch REST endpoint for your cluster
- An API key, or a username and password, with read access to the indices you want to query
Connection setup
- From your Basedash dashboard, click “Add Data Source”
- Select “Elasticsearch” as your database type
- Enter your Elasticsearch endpoint (e.g.,
https://example.es.cloud.es.io:443). Use the Elasticsearch REST URL, not the Kibana URL, and include the port if needed - Choose an authentication method:
- API key: paste the encoded API key from Elasticsearch
- Username and password: enter the credentials for a dedicated user
- Click “Test Connection” to verify
- Save your connection
Required permissions
Grant the API key or user these index privileges on the indices and data streams you want to query:readview_index_metadata
Best practices
- Create a dedicated API key or user for Basedash
- Limit privileges to the indices Basedash needs
- Regularly rotate API keys and passwords
Troubleshooting
- If you see an “SQL endpoint not found” error, check that you used the Elasticsearch endpoint (not Kibana) and that the SQL API is enabled
- Verify the API key or user has
readandview_index_metadataon the target indices - Use unique column aliases in SQL; Elasticsearch rejects results with duplicate column names
Next steps: Add custom context
You can add custom context to help the AI better understand your data structure and business logic. Consider adding context at the database or schema level if you notice the AI struggling to locate or understand specific data.When to add context
- Nested or object fields: When the AI needs help understanding document structure
- Unclear naming conventions: If index or field names don’t clearly indicate their purpose
- Time-based indices: When the AI should know which index pattern or timestamp field to use