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 OverflowBasic Elastic Search Query
Query Elasticsearch from Grafana
Elasticsearch Query in Grafana
How to query Elasticsearch datasource in Grafana? - Elasticsearch - Discuss the Elastic Stack
Can Grafana connect directly to Elasticsearch?
How do I connect Elasticsearch to Grafana using Docker?
What is Elasticsearch used for?
I'm currently trying to use grafana for a project that I'm assigned
I have a transformed elastic search index with a category and timestamp field. I want a table visualization every 5 min for a given query to get all entries in this index where now() - timestamp > 1 hour and category is 'unprocessed' OR get all entries in this index where category is 'error'.
All examples I've read so far use numerical metrics, and I'm currently lost on making this visualization. I think my lucene query is wrong because incorrect data is being shown.
Can someone help me with the lucene query or is there a way to use elastic API instead? Or is there a better way of doing this (like transforming the index first to some other format)? The goal is just to show a list of anomalous entries
I would like to get your thoughts on this and any resources you could point me to would be greatly appreciated. Thank you very much!