title: Grafana Singlestat: select with timerange
body: <p>I am trying to use the <code>SingleStat</code> Plugin of Grafana to add an online/offline indicator to one of my dashboards. </p>
  
  <p>So what I have so far is this with an influxdb datasource:
  <a href="https://i.stack.imgur.com/A6T1H.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A6T1H.png" alt="enter image description here"></a></p>
  
  <p>What I am missing is the option to define a timerange for this query. Lets say I want the count() of the last 30min. If the count is 0 I know that the server is offline. If the count is > 0 he is online. (For example my server adds a new entry every 20min. So if I don´t have an entry in the last 30min I know he must be offline)</p>
  
  <p>So is it possible to get define a query with a timerange? When yes how ?</p>
  
  <p><strong>UPDATE</strong>
  This is what I have so far now. But I get an error now which says <em>a.form is undefined</em>. Alos if I have a entry in the last 35min it doesnst switch to online.
  <a href="https://i.stack.imgur.com/Lhigs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Lhigs.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/sHv3x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sHv3x.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/aWO6g.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aWO6g.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/MpaIn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MpaIn.png" alt="enter image description here"></a></p>