Verify Elasticsearch is accessible
Before you connect Grafana to Elasticsearch, confirm that your Elasticsearch instance is running and that you have the information Grafana needs to establish a connection.
Gather connection details
Collect the following values before proceeding:
The URL is the only required connection value. Index name and Time field name are optional Elasticsearch details — Grafana defaults the time field to @timestamp — but setting them makes querying easier. The Elasticsearch data source supports v7.17 or later, v8.x, v9.x, and Elastic Cloud Serverless.
Verify connectivity
Confirm Elasticsearch is reachable by running this command from your terminal:
curl -s -o /dev/null -w "%{http_code}" http://YOUR_ELASTICSEARCH_HOST:9200A 200 response confirms that Elasticsearch is accepting connections. If your instance requires authentication, add credentials with -u username:password or an API key header.
If Elasticsearch is behind a firewall: You’ll need Private data source connect (PDC) to allow Grafana Cloud to reach it. Set up PDC before continuing.
Confirm read permissions
When Elasticsearch security features are enabled, the user or API key that Grafana connects with needs the following cluster privileges:
- monitor — Retrieves version information for the connected Elasticsearch instance.
- view_index_metadata — Accesses the mapping definitions of indices.
- read — Performs search and retrieval operations on indices.
Security tip: Scope the credentials to the minimum privileges Grafana needs — read access to the indices you want to query. Refer to Configure the Elasticsearch data source for details.
In the next milestone, you’ll add Elasticsearch as a data source in Grafana Cloud.