How to add Elasticsearch datasource

I’m trying to add Elasticsearch datasource but resulted in below error.

Plesae help to add elasticsearch as datasource


This feels like an authentication issue, but not sure. Can you browse the elasticsearch url you’ve entered in the URL field without problem? Is that URL protected by some sort of authentication.

Please make sure that Grafana can access the elasticsearch url, maybe firewall problem?


It is publicly accessable now but still index error


You seem to have configured your index incorrectly in the index name field.

What’s the result of this command:

curl -XGET '<your elastic url with port>/_cat/indices?v&pretty'


So yeah, you don’t have any metricbeat indices in your elasticsearch instance why you couldn’t specify those in Index Name.

I can see that you have an index named customer so in case you want to visualize data from that index in Grafana insert customer in the Index Name field.

Error: No date field named @timestamp found
Could you please help on this.

The cat/_indices output shows you have no documents in the customer index. So Grafana couldn’t find any documents or a mapping with a @timstamp field. Are you sure your data is getting in to elasticsearch?

1 Like

Thanks all,
now im able to connect to Elasticsearch datasource

1 Like

Hello mefraimsson,
I can query the index of aai-event, but it still shows no such index. Can you know what caused it?

@liuman please change Pattern to none

Thank you for your quick reply, we have now changed the demo process. Temporarily put down grafana

I’ve had similar issues in the past using elasticsearch.

Trying out Grafana today, I had this exact issue, for me I did the following:

In Kibana go to the Mangement and Index Patterens.

First, I tried to refresh the index, but this had no effect.

I then deleted the index and then recreated it. ( and just to be sure on the 2nd step of creating an index I went into advanced and gave the custom pattern ID the same as the index pattern I named in step 1. )

After this, I could connect from Grafana to elasticsearch ok.

Note: The advanced / custom pattern settnig may not be needed, but delete and re-create is.

Note: Like the user above I didn’t have many indexes. It might be a fresh install of elasticsearch got in a tanglement. It might be I was running it in docker and didn’t have correct file permissions. In short, I think this is a rare issue, but happens time to time.


If i have many Index Name such as

How to set grafana Index Name I try to config *_* in Index Name

It is not import all my metricbeat.