# Custom SQL on Influxdb,Telegraf

**URL:** <https://community.influxdata.com/t/custom-sql-on-influxdb-telegraf/2511>\
**Category:** Telegraf\
**Tags:** influxdb, telegraf, grafana\
**Created:** [September 27, 2017, 8:58pm UTC](https://community.influxdata.com/t/custom-sql-on-influxdb-telegraf/2511 "2017-09-27T20:58:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![srajeevan](https://avatars.discourse-cdn.com/v4/letter/s/a6a055/32.png) [@srajeevan](https://community.influxdata.com/u/srajeevan)\
**Post date:** [September 27, 2017, 8:58pm UTC](https://community.influxdata.com/t/custom-sql-on-influxdb-telegraf/2511/1 "2017-09-27T20:58:31Z")

</div>

Hi…I am using Influxdb with gafana using telegraf agent.  
Telegraf is capturing all the sql server metrices.I want to show last executed 5 queries on a db or some custom infromation.  
How do i achieve it.?  
Right now i cant query the measurements which is present in Influxdb and show it in grafana,but can i go beyond that and write a custom query to get a result.

---

<div class="post-metadata">

**Author:** ![daniel](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/daniel/32/142_2.png) [@daniel](https://community.influxdata.com/u/daniel)\
**Post date:** [September 27, 2017, 9:28pm UTC](https://community.influxdata.com/t/custom-sql-on-influxdb-telegraf/2511/2 "2017-09-27T21:28:30Z")

</div>

Telegraf does not currently have support for sending custom queries to SQL Server, but we hope to [add it soon](https://github.com/influxdata/telegraf/pull/2785).
