# Inserting results in to table in Mustache template

**URL:** <https://forum.opensearch.org/t/inserting-results-in-to-table-in-mustache-template/4794>\
**Category:** Open Source Elasticsearch and Kibana\
**Created:** [February 1, 2021, 6:51am UTC](https://forum.opensearch.org/t/inserting-results-in-to-table-in-mustache-template/4794 "2021-02-01T06:51:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saravana37](https://avatars.discourse-cdn.com/v4/letter/s/49beb7/32.png) [@Saravana37](https://forum.opensearch.org/u/Saravana37)\
**Post date:** [February 1, 2021, 6:51am UTC](https://forum.opensearch.org/t/inserting-results-in-to-table-in-mustache-template/4794/1 "2021-02-01T06:51:58Z")

</div>

Hello All ,

I am trying to insert my results into a table using Mustache template . I am trying the below code but it is not working . Kindly help.

```
Found {{ctx.results.0.hits.total.value}} component(s) with issues! Please check enclosed report
- MonitorName: {{ctx.monitor.name}}
- trigger name: {{ctx.trigger.name}}
- PeriodStart: {{ctx.periodStart}}
- PeriodEnd: {{ctx.periodEnd}}
                
{{#ctx.results}}
      {{#hits}}
          {{#hits}}
		  {{#_source}}
<script id="mustache-template" type="text/template">
    <table>
        <thead>
		 <tr>
		  <th> timestamp </th>
		  <th> Server </th>
          <th> ComponentAlias </th>
          <th> ComponentStatus </th>
		  </tr>
	    </thead>
        <tbody>
        
            <tr>
                <td>{{@timestamp}}</td>
                <td>{{ServerName}}</td>
				<td>{{ComponentAlias}}</td>
                <td>{{ComponentStatus}}</td>
            </tr>
       
        </tbody>
    </table>
</script>
			  {{/_source}}
          {{/hits}}
      {{/hits}}
  {{/ctx.results}}

```

---

<div class="post-metadata">

**Author:** ![kris](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/kris/32/2208_2.png) [@kris](https://forum.opensearch.org/u/kris)\
**Post date:** [February 7, 2023, 12:03am UTC](https://forum.opensearch.org/t/inserting-results-in-to-table-in-mustache-template/4794/2 "2023-02-07T00:03:14Z")

</div>


