I figured it out.
First, you need to go to Data Sources in Grafana, and choose Elasticsearch.

You put your index name here. And most importantly, you need a field that can tell time. I used date field. I made a simple sample data like the below. (Look at the date field.)

Go to Grafana dashboard. And in the query, you will see that Date Histogram will be automatically set to date. Choose the metric that you want.

You will see something like this on your graph.

I know my data, field, and so on is not ideal graph material. But I focused on how, not what. Please think of this as 'hello world' for Elastic and Grafana. Hope this helps someone and save their time and energy.
Answer from Jin Lee on Stack OverflowGrafana
grafana.com › docs › grafana › latest › datasources › elasticsearch › query-editor
Elasticsearch query editor | Grafana documentation
There are two types of queries you can create with the Elasticsearch query builder. Each type is explained in detail below. Use the Preserve query toggle to keep your Lucene query when you switch between Metrics, Logs, Raw Data, and Raw Document. When the toggle is off (the default for new queries), switching query types clears the Lucene query. Grafana remembers your last Preserve query choice in the browser for new queries.
Basic Elastic Search Query
Hi Team, Here are my elastic search get results. Can u help me to plot a time series graph with lucene query on grafana? I have the data source configured. {“took”:3,“timed_out”:false,"_shards":{“total”:5,“successful”:5,“failed”:0},“hits”:{“total”:4,“max_score... More on community.grafana.com
Query Elasticsearch from Grafana
Hello, I am trying to visualize some data in Grafana that I get from Elasicsearch. I was able to add the data source and I am able to visualize simple things like the count time series for an index. What I am not able to do is: Group by successfully. I am trying to group by with “Terms” ... More on community.grafana.com
Elasticsearch Query in Grafana
Environment: Grafana 8, elasticsearch 7.14 I have a dashboard where I have variables for Terminal, Maturity (UAT,PROD) and server as below The user can then select the terminal and maturity to display metrics for. I am using jolokia and metric beat to send JMX and system metrics to elasticsearch I can query ... More on community.grafana.com
How to query Elasticsearch datasource in Grafana? - Elasticsearch - Discuss the Elastic Stack
I want to use an index in Elasticsearch as a data source in Grafana. But I can't query it and extract a specific field from it. I want to have only the data of the fields I want as output from among several fields in this data source, like an RDBMs where columns can be selected. in elasticsearch, ... More on discuss.elastic.co
Can Grafana connect directly to Elasticsearch?
Yes. Grafana supports Elasticsearch as a native data source, enabling users to visualize and monitor data directly.
metricfire.com
metricfire.com › blog › using grafana with elasticsearch (tutorial)
Using Grafana with Elasticsearch: Complete Tutorial | MetricFire ...
How do I connect Elasticsearch to Grafana using Docker?
Run both Grafana and Elasticsearch containers in the same Docker network and use 'http://elasticsearch:9200' as the data source URL.
metricfire.com
metricfire.com › blog › using grafana with elasticsearch (tutorial)
Using Grafana with Elasticsearch: Complete Tutorial | MetricFire ...
What is Elasticsearch used for?
Elasticsearch is an open-source search and analytics engine that indexes structured and unstructured data for fast search and aggregation.
metricfire.com
metricfire.com › blog › using grafana with elasticsearch (tutorial)
Using Grafana with Elasticsearch: Complete Tutorial | MetricFire ...
Grafana
community.grafana.com › elasticsearch
Query Elasticsearch from Grafana - Elasticsearch - Grafana Labs Community Forums
May 14, 2020 - Hello, I am trying to visualize some data in Grafana that I get from Elasicsearch. I was able to add the data source and I am able to visualize simple things like the count time series for an index. What I am not able to do is: Group by successfully. I am trying to group by with “Terms” and selecting a keyword field (a keyword text field with name structure .keyword).
Grafana
community.grafana.com › t › elasticsearch-query-in-grafana › 52102
Elasticsearch Query in Grafana - Grafana - Grafana Labs Community Forums
August 19, 2021 - Environment: Grafana 8, elasticsearch 7.14 I have a dashboard where I have variables for Terminal, Maturity (UAT,PROD) and server as below The user can then select the terminal and maturity to display metrics for. I am using jolokia and metric beat to send JMX and system metrics to elasticsearch I can query using elastichead and see the data I need to dashboard based on the same filters the dashboard appears to be using BUT when I have the following query I see data (servers) for mul...
Stack Overflow
stackoverflow.com › questions › 64782550 › grafana-and-elasticsearch-how-to-perform-a-simple-query
Grafana and Elasticsearch: How to perform a simple query - Stack Overflow
As setted in official Grafana documentation, Lucene queries can be used in the query field.
Grafana
community.grafana.com › elasticsearch
Grafana Variables Query using ElasticSearch - Filter doesn't work - Elasticsearch - Grafana Labs Community Forums
November 7, 2022 - am currently using Grafana v9.1.7 and ElasticSearch 8.4.2 What I’m trying to achieve is to create a dashboard that can filter the data by country. I have a keyword field named honeypot_country (it’s a string that mapped into keyword in elastic). When this filter is selected, it should only ...
Grafana
grafana.com › docs › grafana › latest › datasources › elasticsearch › template-variables
Elasticsearch template variables | Grafana documentation
The Elasticsearch data source supports two variable syntaxes for use in the Query field: $varname, such as hostname:$hostname, which is easy to read and write but doesn’t let you use a variable in the middle of a word. ... When the Multi-value or Include all value options are enabled, Grafana converts the labels from plain text to a Lucene-compatible condition.
Huihoo
docs.huihoo.com › grafana › 2.6 › datasources › elasticsearch › index.html
Elasticsearch - Grafana Documentation - Huihoo
The Elasticsearch query editor allows you to select multiple metrics and group by multiple terms or filters. Use the plus and minus icons to the right to add / remove metrics or group bys. Some metrics and group by have options, click the option text to expand the the row to view and edit metric ...
Grafana
grafana.github.io › grafonnet › API › query › elasticsearch › index.html
elasticsearch - Grafonnet
Set the datasource for this query. ... If hide is set to true, Grafana will filter out the response(s) associated with this query before returning it to the panel.
Grafana
community.grafana.com › configuration
How to write query for a variable for an elasticsearch source? - Configuration - Grafana Labs Community Forums
August 28, 2018 - In the dashboard settings, I want to create a variable so that I can have the option to see the metrics panel for that particular host. I cannot seem to figure out the correct query syntax for the fields that contains th…
Grafana
grafana.com › grafana › plugins › elasticsearch
Elasticsearch plugin for Grafana | Grafana Labs
July 13, 2026 - Grafana ships with advanced support for Elasticsearch. You can do many types of simple or complex elasticsearch queries to visualize logs or metrics stored in Elasticsearch.