How to Query to index in elasticsearch through grafana

I am using elasticsearch version 6.0.0 and grafana version 4.5.2
I am working on project where our daily automation results are saved as indices in elastic search.
Each automation result will create an index in Elasticsearch with “component name” as "index name"
Each index has key-value pairs such as create_date, end_date, success_cases, failure_cases for a component which are stored as JSON document. This is will dynamically done through Java program.

Now we want to show the trend of that component graphically through Grafana dashboard i.e. graph will show the success count , failure count of each day of that component.
First question is that is it possible achieve it ?
If yes, how to achieve it using annotations or templates ? how to write simple query for the same
Can anybody help me out here ?
Waiting for reply

with Regards


Should be possible. What have you tried so far?

Please see elasticsearch annotations documentation.