MSSQL Uptime/Downtime

Hi I want to present uptime/downtime using Grafana with time series.

My MS SQL data:

image

I got to this point where my query is:

A)
SELECT
TimeStamp as time,
StatusNo as IDLE
FROM
MachineLearning.dbo.KF
WHERE
TableNo like ‘M6-4A’ AND StatusNo like ‘0’
ORDER BY TimeStamp ASC

B)
SELECT
TimeStamp as time,
StatusNo as WIP
FROM
MachineLearning.dbo.KF
WHERE
TableNo like ‘M6-4A’ AND StatusNo like ‘1’
ORDER BY TimeStamp ASC

but it only works when I select Format as ‘Table’ and when I filter the data to ‘last 5 mins’ - data outside time range shows on the graph.

I am a bit lost, I am new to Grafana.

Thanks in advance!
Rodimir

Hi, are you using Grafna 8?

If so, this note and related issue might help:

Hi Matt,

Thanks for the response! I have v7.5. Do I need to upgrade to v8?

-rodimirv

no need to upgrade. Can you share your panel json?

Here’s one:

{

“aliasColors”: {

"IDLE": "super-light-green",

"WIP": "green"

},

“bars”: false,

“dashLength”: 10,

“dashes”: false,

“fieldConfig”: {

"defaults": {

  "unit": "short"

},

"overrides": []

},

“fill”: 10,

“fillGradient”: 0,

“gridPos”: {

"h": 8,

"w": 12,

"x": 0,

"y": 0

},

“hiddenSeries”: false,

“id”: 8,

“legend”: {

"alignAsTable": false,

"avg": false,

"current": false,

"max": false,

"min": false,

"show": true,

"total": false,

"values": false

},

“lines”: true,

“linewidth”: 0,

“nullPointMode”: “null as zero”,

“options”: {

"alertThreshold": true

},

“percentage”: false,

“pluginVersion”: “7.5.7”,

“pointradius”: 0.5,

“points”: false,

“renderer”: “flot”,

“seriesOverrides”: [],

“spaceLength”: 10,

“stack”: true,

“steppedLine”: true,

“targets”: [

{

  "alias": "",

  "format": "table",

  "hide": false,

  "rawSql": "SELECT \r\n      TimeStamp as time,\r\n      StatusNo as IDLE\r\nFROM \r\n   MachineLearning.dbo.KF\r\nWHERE\r\n  TableNo like 'M6-4A' AND StatusNo like '0'\r\nORDER BY TimeStamp ASC",

  "refId": "A"

},

{

  "alias": "",

  "format": "table",

  "hide": false,

  "rawSql": "SELECT \r\n      TimeStamp as time,\r\n      StatusNo as WIP\r\nFROM \r\n   MachineLearning.dbo.KF\r\nWHERE\r\n  TableNo like 'M6-4A' AND StatusNo like '1'\r\n  ORDER BY TimeStamp ASC",

  "refId": "C"

}

],

“thresholds”: [],

“timeFrom”: null,

“timeRegions”: [],

“timeShift”: null,

“title”: “KingFisher Uptime/Downtime M6-4A”,

“tooltip”: {

"shared": true,

"sort": 0,

"value_type": "individual"

},

“type”: “graph”,

“xaxis”: {

"buckets": null,

"mode": "time",

"name": null,

"show": true,

"values": []

},

“yaxes”: [

{

  "format": "short",

  "label": null,

  "logBase": 1,

  "max": null,

  "min": null,

  "show": true

},

{

  "format": "short",

  "label": null,

  "logBase": 1,

  "max": null,

  "min": null,

  "show": true

}

],

“yaxis”: {

"align": false,

"alignLevel": null

},

“datasource”: null

}

can you put all that in a code block? and the data in another?

Like this?

{
  "aliasColors": {
    "IDLE": "super-light-green",
    "WIP": "green"
  },
  "bars": false,
  "dashLength": 10,
  "dashes": false,
  "fieldConfig": {
    "defaults": {
      "unit": "short"
    },
    "overrides": []
  },
  "fill": 10,
  "fillGradient": 0,
  "gridPos": {
    "h": 8,
    "w": 12,
    "x": 0,
    "y": 0
  },
  "hiddenSeries": false,
  "id": 23763571993,
  "legend": {
    "alignAsTable": false,
    "avg": false,
    "current": false,
    "max": false,
    "min": false,
    "show": true,
    "total": false,
    "values": false
  },
  "lines": true,
  "linewidth": 0,
  "nullPointMode": "null as zero",
  "options": {
    "alertThreshold": true
  },
  "percentage": false,
  "pluginVersion": "7.5.7",
  "pointradius": 0.5,
  "points": false,
  "renderer": "flot",
  "seriesOverrides": [],
  "spaceLength": 10,
  "stack": true,
  "steppedLine": true,
  "targets": [
    {
      "alias": "",
      "format": "table",
      "hide": false,
      "rawSql": "SELECT \r\n      TimeStamp as time,\r\n      StatusNo as IDLE\r\nFROM \r\n   MachineLearning.dbo.KF\r\nWHERE\r\n  TableNo like 'M6-4A' AND StatusNo like '0'\r\nORDER BY TimeStamp ASC",
      "refId": "A"
    },
    {
      "alias": "",
      "format": "table",
      "hide": false,
      "rawSql": "SELECT \r\n      TimeStamp as time,\r\n      StatusNo as WIP\r\nFROM \r\n   MachineLearning.dbo.KF\r\nWHERE\r\n  TableNo like 'M6-4A' AND StatusNo like '1'\r\n  ORDER BY TimeStamp ASC",
      "refId": "C"
    }
  ],
  "thresholds": [],
  "timeFrom": null,
  "timeRegions": [],
  "timeShift": null,
  "title": "KingFisher Uptime/Downtime M6-4A",
  "tooltip": {
    "shared": true,
    "sort": 0,
    "value_type": "individual"
  },
  "type": "graph",
  "xaxis": {
    "buckets": null,
    "mode": "time",
    "name": null,
    "show": true,
    "values": []
  },
  "yaxes": [
    {
      "format": "short",
      "label": null,
      "logBase": 1,
      "max": null,
      "min": null,
      "show": true,
      "$$hashKey": "object:122"
    },
    {
      "format": "short",
      "label": null,
      "logBase": 1,
      "max": null,
      "min": null,
      "show": true,
      "$$hashKey": "object:123"
    }
  ],
  "yaxis": {
    "align": false,
    "alignLevel": null
  },
  "datasource": null
}
time	IDLE
5/21/2021 10:43	0
5/21/2021 10:50	0
5/21/2021 10:51	0
5/21/2021 10:56	0
5/21/2021 10:56	0
5/21/2021 11:03	0
5/21/2021 11:03	0
5/21/2021 11:25	0
5/21/2021 11:25	0
5/21/2021 11:29	0
5/21/2021 11:38	0
5/21/2021 11:38	0
5/21/2021 12:26	0
5/21/2021 12:26	0
5/21/2021 12:27	0
5/21/2021 12:27	0
5/21/2021 13:39	0
5/21/2021 13:43	0
5/21/2021 13:44	0
5/21/2021 13:49	0
5/21/2021 13:50	0
5/21/2021 13:51	0
5/21/2021 13:51	0
5/21/2021 13:57	0
5/21/2021 13:57	0
5/21/2021 13:59	0
5/21/2021 14:28	0
5/21/2021 14:28	0
5/21/2021 15:45	0
5/21/2021 15:48	0
5/21/2021 15:48	0
5/21/2021 16:16	0
5/21/2021 16:16	0
5/21/2021 16:16	0
5/21/2021 16:17	0
5/21/2021 16:19	0
5/21/2021 16:20	0
5/21/2021 16:21	0
5/21/2021 16:21	0
5/21/2021 16:24	0
5/21/2021 16:28	0
5/21/2021 16:29	0
5/21/2021 17:36	0
5/21/2021 17:37	0
5/21/2021 18:12	0
5/21/2021 18:13	0
5/21/2021 18:13	0
5/21/2021 18:17	0
5/21/2021 18:18	0
5/21/2021 18:29	0
5/21/2021 18:29	0
5/21/2021 18:31	0
5/21/2021 18:31	0
5/21/2021 18:34	0
5/21/2021 18:39	0
5/21/2021 18:40	0
5/21/2021 19:25	0
5/21/2021 19:25	0
5/21/2021 19:25	0
5/21/2021 19:25	0
5/21/2021 19:39	0
5/21/2021 19:39	0
5/21/2021 19:40	0
5/21/2021 19:41	0
5/21/2021 19:41	0
5/21/2021 19:42	0
5/21/2021 19:43	0
5/21/2021 19:53	0
5/21/2021 19:54	0
5/21/2021 19:55	0
5/21/2021 19:56	0
5/21/2021 19:57	0
5/21/2021 21:03	0
5/22/2021 2:42	0
5/22/2021 2:50	0
5/22/2021 3:29	0
5/22/2021 3:29	0
5/22/2021 3:33	0
5/22/2021 3:34	0
5/22/2021 3:34	0
5/22/2021 3:34	0
5/22/2021 3:35	0
5/22/2021 3:35	0
5/22/2021 3:36	0
5/22/2021 3:37	0
5/22/2021 3:37	0
5/22/2021 3:38	0
5/22/2021 3:38	0
5/22/2021 3:38	0
5/22/2021 3:38	0
5/22/2021 3:39	0
5/22/2021 3:39	0
5/22/2021 3:49	0
5/22/2021 3:49	0
5/22/2021 3:51	0
5/22/2021 3:56	0
5/22/2021 4:00	0
5/22/2021 4:00	0
5/22/2021 4:04	0
5/22/2021 4:04	0
5/22/2021 4:10	0
5/22/2021 4:10	0
5/22/2021 4:24	0
5/22/2021 4:24	0
5/22/2021 4:26	0
5/22/2021 4:27	0
5/22/2021 4:27	0
5/22/2021 4:28	0
5/22/2021 4:28	0
5/22/2021 4:28	0
5/22/2021 4:29	0
5/22/2021 5:11	0
5/22/2021 5:24	0
5/22/2021 5:49	0
5/22/2021 5:50	0
5/22/2021 5:58	0
5/22/2021 5:58	0
5/22/2021 17:02	0
5/22/2021 17:04	0
5/22/2021 17:05	0
5/22/2021 17:06	0
5/22/2021 17:07	0
5/22/2021 17:07	0
5/22/2021 17:07	0
5/22/2021 17:08	0
5/22/2021 17:12	0
5/22/2021 17:12	0
5/22/2021 17:12	0
5/22/2021 17:16	0
5/22/2021 17:16	0
5/22/2021 17:16	0
5/22/2021 17:31	0
5/22/2021 22:57	0
5/22/2021 22:57	0
5/23/2021 2:29	0
5/23/2021 2:31	0
5/23/2021 2:39	0
5/23/2021 2:57	0
5/23/2021 2:58	0
5/23/2021 3:05	0
5/23/2021 3:06	0
5/23/2021 3:07	0
5/23/2021 3:07	0
5/23/2021 3:14	0
5/23/2021 3:24	0
5/23/2021 3:50	0
5/23/2021 3:50	0
5/23/2021 3:56	0
5/23/2021 3:56	0
5/23/2021 4:23	0
5/23/2021 4:24	0
5/23/2021 8:58	0
5/23/2021 8:58	0
5/23/2021 8:58	0
5/23/2021 8:58	0
5/23/2021 16:15	0
5/23/2021 16:15	0
5/23/2021 16:25	0
5/23/2021 16:25	0
5/23/2021 16:25	0
5/23/2021 16:36	0
5/23/2021 16:55	0
5/23/2021 17:00	0
5/23/2021 17:02	0
5/23/2021 18:34	0
5/23/2021 18:34	0
5/24/2021 1:34	0
5/24/2021 1:34	0
5/24/2021 1:34	0
5/24/2021 2:03	0
5/24/2021 2:04	0
5/24/2021 2:09	0
5/24/2021 2:10	0
5/24/2021 2:19	0
5/24/2021 2:20	0
5/24/2021 2:21	0
5/24/2021 2:21	0
5/24/2021 2:27	0
5/24/2021 2:28	0
5/24/2021 2:28	0
5/24/2021 2:28	0
5/24/2021 2:31	0
5/24/2021 2:31	0
5/24/2021 2:33	0
5/24/2021 2:33	0
5/24/2021 2:34	0
5/24/2021 3:00	0
5/24/2021 3:26	0
5/24/2021 3:40	0
5/24/2021 3:54	0
5/24/2021 4:23	0
5/24/2021 4:24	0
5/24/2021 4:38	0
5/24/2021 4:44	0
5/24/2021 4:51	0
5/24/2021 5:01	0
5/24/2021 5:05	0
5/24/2021 5:08	0
5/24/2021 5:08	0
5/24/2021 5:08	0
5/24/2021 5:09	0
5/24/2021 5:09	0
5/24/2021 6:02	0
5/24/2021 6:04	0
5/24/2021 6:10	0
5/24/2021 6:13	0
5/24/2021 6:24	0
5/24/2021 6:47	0
5/24/2021 6:49	0
5/24/2021 6:54	0
5/24/2021 6:57	0
5/24/2021 7:02	0
5/24/2021 7:02	0
5/24/2021 7:15	0
5/24/2021 7:36	0
5/24/2021 7:42	0
5/24/2021 8:01	0
5/24/2021 8:06	0
5/24/2021 8:14	0
5/24/2021 8:26	0
5/24/2021 8:29	0
5/24/2021 8:30	0
5/24/2021 8:46	0
5/24/2021 9:01	0
5/24/2021 9:07	0
5/24/2021 9:16	0
5/24/2021 9:23	0
5/24/2021 10:35	0
5/24/2021 10:59	0
5/24/2021 10:59	0
5/24/2021 11:04	0
5/24/2021 11:37	0
5/24/2021 11:38	0
5/24/2021 11:42	0
5/24/2021 11:46	0
5/24/2021 11:47	0
5/24/2021 11:57	0
5/24/2021 11:59	0
5/24/2021 12:01	0
5/24/2021 12:06	0
5/24/2021 12:07	0
5/24/2021 12:19	0
5/24/2021 12:24	0
5/24/2021 12:56	0
5/24/2021 13:04	0
5/24/2021 13:04	0
5/24/2021 13:04	0
5/24/2021 13:06	0
5/24/2021 13:06	0
5/24/2021 13:06	0
5/24/2021 13:06	0
5/24/2021 13:06	0
5/24/2021 13:17	0
5/24/2021 13:17	0
5/24/2021 13:17	0
5/24/2021 13:17	0
5/24/2021 13:18	0
5/24/2021 13:19	0
5/24/2021 13:28	0
5/24/2021 13:30	0
5/24/2021 13:31	0
5/24/2021 13:31	0
5/24/2021 13:34	0
5/24/2021 13:35	0
5/24/2021 13:42	0
5/24/2021 14:00	0
5/24/2021 14:49	0
5/24/2021 15:33	0
5/24/2021 15:33	0
5/24/2021 15:34	0
5/24/2021 15:34	0
5/24/2021 17:00	0
5/24/2021 17:01	0
5/24/2021 17:28	0
5/24/2021 17:28	0
5/24/2021 17:58	0
5/24/2021 17:58	0
5/24/2021 18:15	0
5/24/2021 18:15	0
5/24/2021 18:41	0
5/24/2021 18:41	0
5/24/2021 19:19	0
5/24/2021 19:20	0
5/24/2021 19:25	0
5/24/2021 19:27	0
5/24/2021 19:33	0
5/24/2021 19:41	0
5/24/2021 19:46	0
5/24/2021 19:50	0
5/24/2021 20:05	0
5/24/2021 21:03	0
5/24/2021 21:05	0
5/25/2021 1:33	0
5/25/2021 1:52	0
5/25/2021 1:52	0
5/25/2021 2:38	0
5/25/2021 2:40	0
5/25/2021 2:41	0
5/25/2021 2:41	0
5/25/2021 2:42	0
5/25/2021 2:42	0
5/25/2021 2:42	0
5/25/2021 2:42	0
5/25/2021 2:43	0
5/25/2021 2:43	0
5/25/2021 2:47	0
5/25/2021 2:47	0
5/25/2021 2:47	0
5/25/2021 2:47	0
5/25/2021 2:52	0
5/25/2021 2:52	0
5/25/2021 2:56	0
5/25/2021 2:56	0
5/25/2021 3:08	0
5/25/2021 3:08	0
5/25/2021 3:08	0
5/25/2021 3:08	0
5/25/2021 3:08	0
5/25/2021 3:12	0
5/25/2021 3:12	0
5/25/2021 3:12	0
5/25/2021 3:33	0
5/25/2021 3:33	0
5/25/2021 3:35	0
5/25/2021 3:36	0
5/25/2021 3:42	0
5/25/2021 3:42	0
5/25/2021 3:45	0
5/25/2021 3:45	0
5/25/2021 3:50	0
5/25/2021 3:50	0
5/25/2021 3:56	0
5/25/2021 3:56	0
5/25/2021 3:56	0
5/25/2021 4:04	0
5/25/2021 4:05	0
5/25/2021 4:08	0
5/25/2021 4:08	0
5/25/2021 4:09	0
5/25/2021 4:09	0
5/25/2021 4:12	0
5/25/2021 4:16	0
5/25/2021 4:16	0
5/25/2021 4:19	0
5/25/2021 4:20	0
5/25/2021 4:36	0
5/25/2021 4:39	0
5/25/2021 4:43	0
5/25/2021 4:55	0
5/25/2021 4:56	0
5/25/2021 4:58	0
5/25/2021 5:21	0
5/25/2021 5:32	0
5/25/2021 5:44	0
5/25/2021 6:01	0
5/25/2021 6:01	0
5/25/2021 6:01	0
5/25/2021 6:06	0
5/25/2021 6:06	0
5/25/2021 6:09	0
5/25/2021 6:28	0
5/25/2021 6:29	0
5/25/2021 6:30	0
5/25/2021 6:30	0
6/3/2021 9:28	0
6/3/2021 9:30	0
6/3/2021 9:30	0
6/3/2021 9:30	0
6/3/2021 9:30	0
6/3/2021 9:30	0
6/3/2021 9:31	0
6/3/2021 9:31	0
6/3/2021 9:31	0
6/3/2021 9:31	0
6/3/2021 9:31	0
6/3/2021 9:31	0
6/3/2021 9:32	0
6/3/2021 9:32	0
6/3/2021 9:33	0
6/3/2021 9:33	0
6/3/2021 9:34	0
6/3/2021 9:34	0
6/3/2021 9:39	0
6/3/2021 9:40	0
6/3/2021 9:44	0
6/3/2021 9:44	0
6/3/2021 9:45	0
6/3/2021 9:45	0
6/3/2021 9:45	0
6/3/2021 9:45	0
6/3/2021 9:45	0
6/3/2021 9:45	0
6/3/2021 9:46	0
6/3/2021 9:48	0
6/3/2021 9:49	0
6/3/2021 9:54	0
6/3/2021 9:55	0
6/3/2021 9:55	0
6/3/2021 9:55	0
6/3/2021 9:56	0
6/3/2021 9:56	0
6/3/2021 9:57	0
6/3/2021 9:57	0
6/3/2021 10:09	0
6/3/2021 10:09	0
6/3/2021 10:22	0
6/3/2021 10:24	0
6/3/2021 10:24	0
6/3/2021 10:24	0
6/3/2021 10:25	0
6/3/2021 10:28	0
6/3/2021 10:29	0
6/3/2021 10:29	0
6/3/2021 10:29	0
6/3/2021 10:30	0
6/3/2021 10:30	0
6/3/2021 10:30	0
6/3/2021 10:31	0
6/3/2021 10:31	0
6/3/2021 10:33	0
6/3/2021 10:33	0
6/3/2021 10:36	0
6/3/2021 10:37	0
6/3/2021 10:37	0
6/3/2021 10:37	0
6/3/2021 10:42	0
6/3/2021 10:43	0
6/3/2021 10:44	0
6/3/2021 10:44	0
6/3/2021 10:45	0
6/3/2021 10:48	0
6/3/2021 10:48	0
6/3/2021 10:49	0
6/3/2021 10:49	0
6/3/2021 10:50	0
6/3/2021 10:50	0
6/3/2021 10:50	0
6/3/2021 10:50	0
6/3/2021 10:51	0
6/3/2021 10:51	0
6/3/2021 10:52	0
6/3/2021 10:53	0
6/3/2021 10:53	0
6/3/2021 10:54	0
6/3/2021 10:54	0
6/3/2021 10:54	0
6/3/2021 10:55	0
6/3/2021 10:57	0
6/3/2021 10:58	0
6/3/2021 10:58	0
6/3/2021 10:58	0
6/3/2021 11:10	0
6/3/2021 11:10	0
6/3/2021 11:36	0
6/3/2021 11:37	0
6/3/2021 11:37	0
6/3/2021 11:37	0
6/3/2021 11:37	0
6/3/2021 11:43	0
6/3/2021 11:43	0
6/3/2021 11:45	0
6/3/2021 11:47	0
6/3/2021 11:49	0
6/3/2021 11:50	0
6/3/2021 11:51	0
6/3/2021 11:52	0
6/3/2021 11:53	0
6/3/2021 11:53	0
6/3/2021 11:54	0
6/3/2021 11:54	0
6/3/2021 11:56	0
6/3/2021 11:56	0
6/3/2021 12:01	0
6/3/2021 12:01	0
6/3/2021 12:02	0
6/3/2021 12:02	0
6/3/2021 12:02	0
6/3/2021 12:02	0
6/3/2021 12:02	0
6/3/2021 12:02	0
6/3/2021 12:03	0
6/3/2021 12:03	0
6/3/2021 12:04	0
6/3/2021 12:04	0
6/3/2021 12:05	0
6/3/2021 12:06	0
6/3/2021 12:06	0
6/3/2021 12:07	0
6/3/2021 12:07	0
6/3/2021 12:08	0
6/3/2021 12:08	0
6/3/2021 12:08	0
6/3/2021 12:08	0
6/3/2021 12:09	0
6/3/2021 12:10	0
6/3/2021 12:12	0
6/3/2021 12:15	0
6/3/2021 12:15	0
6/3/2021 12:15	0
6/3/2021 12:16	0
6/3/2021 12:17	0
6/3/2021 12:18	0
6/3/2021 12:19	0
6/3/2021 12:19	0
6/3/2021 12:19	0
6/3/2021 17:11	0
6/3/2021 17:11	0
6/3/2021 18:18	0
6/3/2021 18:18	0
6/3/2021 18:19	0
6/3/2021 18:20	0
6/3/2021 22:05	0
6/3/2021 22:05	0
6/3/2021 22:07	0
6/3/2021 22:07	0
6/3/2021 22:56	0
6/3/2021 22:57	0
6/4/2021 0:38	0
6/4/2021 0:45	0
6/4/2021 1:02	0
6/4/2021 1:04	0
6/4/2021 1:10	0
6/4/2021 4:36	0
6/4/2021 4:37	0
6/4/2021 4:37	0
6/4/2021 4:37	0
6/4/2021 4:43	0
6/4/2021 4:44	0
6/4/2021 4:55	0
6/4/2021 5:53	0
6/4/2021 5:53	0
6/4/2021 5:56	0
6/4/2021 5:57	0
6/4/2021 5:57	0
6/4/2021 5:57	0
6/4/2021 5:58	0
6/4/2021 5:58	0
6/4/2021 5:59	0
6/4/2021 6:00	0
6/4/2021 6:00	0
6/4/2021 6:01	0
6/4/2021 6:01	0
6/4/2021 6:02	0
6/4/2021 6:02	0
6/4/2021 6:03	0
6/4/2021 6:03	0
6/4/2021 6:03	0
6/4/2021 6:25	0
6/4/2021 6:26	0
6/4/2021 6:28	0
6/4/2021 6:28	0
6/4/2021 6:32	0
6/4/2021 6:33	0
6/4/2021 6:41	0
6/4/2021 6:41	0
6/4/2021 6:49	0
6/4/2021 6:49	0
6/4/2021 7:13	0
6/4/2021 7:13	0
6/4/2021 7:20	0
6/4/2021 7:20	0
6/4/2021 7:22	0
6/4/2021 7:22	0
6/4/2021 7:57	0
6/4/2021 7:57	0
6/4/2021 8:06	0
6/4/2021 8:06	0
6/4/2021 8:13	0
6/4/2021 8:13	0
6/4/2021 8:14	0
6/4/2021 8:14	0
6/4/2021 8:20	0
6/4/2021 8:20	0
6/4/2021 8:20	0
6/4/2021 8:20	0
6/4/2021 8:30	0
6/4/2021 8:30	0
6/4/2021 8:48	0
6/4/2021 8:48	0
6/4/2021 8:55	0
6/4/2021 8:56	0
6/4/2021 10:07	0
6/4/2021 10:07	0
6/4/2021 10:57	0
6/4/2021 10:58	0
6/4/2021 11:37	0
6/4/2021 11:37	0
6/4/2021 11:38	0
6/4/2021 11:38	0
6/4/2021 11:44	0
6/4/2021 11:44	0
6/4/2021 13:09	0
6/4/2021 13:09	0
6/4/2021 13:59	0
6/4/2021 14:00	0
6/4/2021 14:07	0
6/4/2021 14:07	0
6/4/2021 14:07	0
6/4/2021 14:08	0
6/4/2021 14:20	0
6/4/2021 14:20	0
6/4/2021 14:20	0
6/4/2021 14:20	0
6/4/2021 14:21	0
6/4/2021 14:21	0
6/4/2021 14:21	0
6/4/2021 14:21	0
6/4/2021 14:47	0
6/4/2021 14:47	0
6/4/2021 14:48	0
6/4/2021 14:48	0
6/4/2021 14:48	0
6/4/2021 14:48	0
6/4/2021 16:33	0
6/4/2021 16:33	0
6/4/2021 16:33	0
6/4/2021 16:33	0
6/4/2021 16:33	0
6/4/2021 16:33	0
6/4/2021 16:45	0
6/4/2021 16:45	0
6/4/2021 17:36	0
6/4/2021 17:37	0
6/4/2021 17:37	0
6/4/2021 17:38	0
6/4/2021 17:38	0
6/4/2021 17:38	0
6/4/2021 17:38	0
6/4/2021 17:38	0
6/4/2021 17:39	0
6/4/2021 17:39	0
6/4/2021 17:39	0
6/4/2021 17:40	0
6/4/2021 17:40	0
6/4/2021 17:42	0
6/4/2021 17:42	0
6/4/2021 17:43	0
6/4/2021 17:43	0
6/4/2021 17:45	0
6/4/2021 17:45	0
6/4/2021 17:45	0
6/4/2021 17:45	0
6/4/2021 17:46	0
6/4/2021 17:48	0
6/4/2021 17:48	0
6/4/2021 17:48	0
6/4/2021 17:49	0
6/4/2021 17:49	0
6/4/2021 17:49	0
6/4/2021 17:49	0
6/4/2021 17:50	0
6/4/2021 17:50	0
6/4/2021 17:50	0
6/4/2021 17:50	0
6/4/2021 17:51	0
6/4/2021 17:51	0
6/4/2021 17:53	0
6/4/2021 17:54	0
6/4/2021 17:54	0
6/4/2021 17:55	0
6/4/2021 17:55	0
6/4/2021 17:56	0
6/4/2021 17:56	0
6/4/2021 17:56	0
6/4/2021 17:56	0
6/4/2021 17:56	0
6/4/2021 17:57	0
6/4/2021 18:01	0
6/4/2021 18:02	0
6/4/2021 18:02	0
6/4/2021 18:02	0
6/4/2021 18:03	0
6/4/2021 18:05	0
6/4/2021 18:05	0
6/4/2021 18:06	0
6/4/2021 18:07	0
6/4/2021 18:07	0
6/4/2021 18:07	0
6/4/2021 18:07	0
6/4/2021 18:09	0
6/4/2021 18:10	0
6/4/2021 18:11	0
6/4/2021 18:11	0
6/4/2021 18:12	0
6/4/2021 18:12	0
6/4/2021 18:13	0
6/4/2021 18:14	0
6/4/2021 18:14	0
6/4/2021 18:15	0
6/4/2021 18:15	0
6/4/2021 18:16	0
6/4/2021 18:17	0
6/4/2021 18:18	0
6/4/2021 18:18	0
6/4/2021 18:18	0
6/4/2021 18:18	0
6/4/2021 18:18	0
6/4/2021 18:18	0
6/4/2021 18:20	0
6/4/2021 18:22	0
6/4/2021 18:23	0
6/4/2021 18:24	0
6/4/2021 18:25	0
6/4/2021 18:25	0
6/4/2021 18:26	0
6/4/2021 18:26	0
6/4/2021 18:27	0
6/4/2021 18:28	0
6/4/2021 18:28	0
6/4/2021 18:28	0
6/4/2021 18:29	0
6/4/2021 18:29	0
6/4/2021 18:30	0
6/4/2021 18:30	0
6/4/2021 18:30	0
6/4/2021 18:30	0
6/4/2021 18:31	0
6/4/2021 18:31	0
6/4/2021 18:31	0
6/4/2021 18:31	0
6/4/2021 18:32	0
6/4/2021 18:32	0
6/4/2021 18:32	0
6/4/2021 18:32	0
6/4/2021 18:33	0
6/4/2021 18:34	0
6/4/2021 18:34	0
6/4/2021 18:35	0
6/4/2021 18:36	0
6/4/2021 18:36	0
6/4/2021 18:36	0
6/4/2021 18:37	0
6/4/2021 18:37	0
6/4/2021 18:37	0
6/4/2021 18:38	0
6/4/2021 18:40	0
6/4/2021 18:41	0
6/4/2021 18:42	0
6/4/2021 18:42	0
6/4/2021 18:43	0
6/4/2021 18:43	0
6/4/2021 18:44	0
6/4/2021 18:45	0
6/4/2021 18:45	0
6/4/2021 18:45	0
6/4/2021 18:45	0
6/4/2021 18:46	0
6/4/2021 18:46	0
6/4/2021 18:46	0
6/4/2021 18:46	0
6/4/2021 18:47	0
6/4/2021 18:47	0
6/4/2021 18:47	0
6/4/2021 18:48	0
6/4/2021 18:48	0
6/4/2021 18:48	0
6/4/2021 18:48	0
6/4/2021 18:48	0
6/4/2021 18:48	0
6/4/2021 18:49	0
6/4/2021 18:49	0
6/4/2021 18:49	0
6/4/2021 18:49	0
6/4/2021 18:49	0
6/4/2021 18:51	0
6/4/2021 18:54	0
6/4/2021 18:54	0
6/4/2021 18:55	0
6/4/2021 18:55	0
6/4/2021 18:56	0
6/4/2021 18:56	0
6/4/2021 18:56	0
6/4/2021 19:02	0
6/4/2021 19:02	0
6/4/2021 19:32	0
6/4/2021 19:32	0
6/4/2021 19:41	0
6/4/2021 19:41	0
6/4/2021 19:42	0
6/4/2021 19:42	0
6/4/2021 19:43	0
6/4/2021 19:43	0
6/4/2021 19:45	0
6/4/2021 19:46	0
6/4/2021 19:46	0
6/4/2021 19:46	0
6/4/2021 19:46	0
6/4/2021 19:47	0
6/4/2021 19:48	0
6/4/2021 19:48	0
6/4/2021 19:48	0
6/4/2021 19:49	0
6/4/2021 19:49	0
6/4/2021 19:50	0
6/4/2021 19:50	0
6/4/2021 19:50	0
6/4/2021 19:51	0
6/4/2021 19:52	0
6/4/2021 19:52	0
6/4/2021 19:53	0
6/4/2021 19:53	0
6/4/2021 19:53	0
6/4/2021 19:53	0
6/4/2021 19:53	0
6/4/2021 19:56	0
6/4/2021 19:57	0
6/4/2021 19:58	0
6/4/2021 19:58	0
6/4/2021 19:59	0
6/4/2021 19:59	0
6/4/2021 20:00	0
6/4/2021 20:01	0
6/4/2021 20:02	0
6/4/2021 20:02	0
6/4/2021 20:02	0
6/4/2021 20:03	0
6/4/2021 20:03	0
6/4/2021 20:03	0
6/4/2021 20:03	0
6/4/2021 20:03	0
6/4/2021 20:04	0
6/4/2021 20:04	0
6/4/2021 20:04	0
6/4/2021 20:05	0
6/4/2021 20:06	0
6/4/2021 20:06	0
6/4/2021 20:06	0
6/4/2021 20:07	0
6/4/2021 20:07	0
6/4/2021 20:07	0
6/4/2021 20:07	0
6/4/2021 20:08	0
6/4/2021 20:09	0
6/4/2021 20:09	0
6/4/2021 20:10	0
6/4/2021 20:11	0
6/4/2021 20:11	0
6/4/2021 20:11	0
6/4/2021 20:12	0
6/4/2021 20:13	0
6/4/2021 20:13	0
6/4/2021 20:14	0
6/4/2021 20:14	0
6/4/2021 20:14	0
6/4/2021 20:14	0
6/4/2021 20:14	0
6/4/2021 20:16	0
6/4/2021 20:16	0
6/4/2021 20:17	0
6/4/2021 20:17	0
6/4/2021 20:17	0
6/4/2021 20:18	0
6/4/2021 20:18	0
6/4/2021 20:18	0
6/4/2021 20:18	0
6/4/2021 20:19	0
6/4/2021 20:19	0
6/4/2021 20:21	0
6/4/2021 20:21	0
6/4/2021 20:21	0
6/4/2021 20:21	0
6/4/2021 20:22	0
6/4/2021 20:23	0
6/4/2021 20:25	0
6/4/2021 20:25	0
6/4/2021 20:26	0
6/4/2021 20:27	0
6/4/2021 20:28	0
6/4/2021 20:29	0
6/4/2021 20:29	0
6/4/2021 20:31	0
6/4/2021 20:31	0
6/4/2021 20:31	0
6/4/2021 20:32	0
6/4/2021 20:32	0
6/4/2021 20:32	0
6/4/2021 20:33	0
6/4/2021 20:33	0
6/4/2021 20:33	0
6/4/2021 20:34	0
6/4/2021 20:36	0
6/4/2021 20:37	0
6/4/2021 20:37	0
6/4/2021 20:38	0
6/4/2021 20:39	0
6/4/2021 20:40	0
6/4/2021 20:40	0
6/4/2021 20:41	0
6/4/2021 20:42	0
6/4/2021 20:42	0
6/4/2021 20:43	0
6/4/2021 20:44	0
6/4/2021 20:46	0
6/4/2021 20:46	0
6/4/2021 20:47	0
6/4/2021 20:47	0
6/4/2021 20:49	0
6/4/2021 20:50	0
6/4/2021 20:52	0
6/4/2021 20:52	0
6/4/2021 20:53	0
6/4/2021 20:53	0
6/4/2021 20:54	0
6/4/2021 20:55	0
6/4/2021 20:55	0
6/4/2021 20:56	0
6/4/2021 20:56	0
6/4/2021 20:56	0
6/4/2021 20:57	0
6/4/2021 20:57	0
6/4/2021 20:58	0
6/4/2021 20:58	0
6/4/2021 20:59	0
6/4/2021 20:59	0
6/4/2021 21:00	0
6/4/2021 21:00	0
6/4/2021 21:00	0
6/4/2021 21:01	0
6/4/2021 21:01	0
6/4/2021 21:01	0
6/4/2021 21:02	0
6/4/2021 21:06	0
6/4/2021 21:07	0
6/4/2021 21:07	0
6/4/2021 21:07	0
6/4/2021 21:08	0
6/4/2021 21:09	0
6/4/2021 21:10	0
6/4/2021 21:11	0
6/4/2021 21:11	0
6/4/2021 21:11	0
6/4/2021 21:11	0
6/4/2021 21:12	0
6/4/2021 21:12	0
6/4/2021 21:12	0
6/4/2021 21:13	0
6/4/2021 21:13	0
6/4/2021 21:13	0
6/4/2021 21:13	0
6/4/2021 21:14	0
6/4/2021 21:15	0
6/4/2021 21:16	0
6/4/2021 21:16	0
6/4/2021 21:17	0
6/4/2021 21:17	0
6/4/2021 21:18	0
6/4/2021 21:19	0
6/4/2021 21:19	0
6/4/2021 21:20	0
6/4/2021 21:20	0
6/4/2021 21:21	0
6/4/2021 21:21	0
6/4/2021 21:22	0
6/4/2021 21:22	0
6/4/2021 21:22	0
6/4/2021 21:22	0
6/4/2021 21:22	0
6/4/2021 21:23	0
6/4/2021 21:23	0
6/4/2021 21:24	0
6/4/2021 21:26	0
6/4/2021 21:27	0
6/4/2021 21:27	0
6/4/2021 21:29	0
6/4/2021 21:29	0
6/4/2021 21:30	0
6/4/2021 21:30	0
6/4/2021 21:31	0
6/4/2021 21:31	0
6/4/2021 21:31	0
6/4/2021 21:32	0
6/4/2021 21:32	0
6/4/2021 21:32	0
6/4/2021 21:33	0
6/4/2021 21:33	0
6/4/2021 21:33	0
6/4/2021 21:33	0
6/4/2021 21:46	0
6/4/2021 21:46	0
6/4/2021 21:47	0
6/4/2021 21:49	0
6/4/2021 21:50	0
6/4/2021 21:50	0
6/4/2021 21:51	0
6/4/2021 21:51	0
6/4/2021 21:52	0
6/4/2021 21:53	0
6/4/2021 21:53	0
6/4/2021 21:54	0
6/4/2021 21:54	0
6/4/2021 21:56	0
6/4/2021 21:56	0
6/4/2021 21:56	0
6/4/2021 21:58	0
6/4/2021 21:59	0
6/4/2021 22:01	0
6/4/2021 22:02	0
6/4/2021 22:02	0
6/4/2021 22:03	0
6/4/2021 22:03	0
6/4/2021 22:03	0
6/4/2021 22:05	0
6/4/2021 22:05	0
6/4/2021 22:05	0
6/4/2021 22:05	0
6/4/2021 22:06	0
6/4/2021 22:06	0
6/4/2021 22:06	0
6/4/2021 22:07	0
6/4/2021 22:07	0
6/4/2021 22:07	0
6/4/2021 22:08	0
6/4/2021 22:08	0
6/4/2021 22:09	0
6/4/2021 22:09	0
6/4/2021 22:10	0
6/4/2021 22:10	0
6/4/2021 22:12	0
6/4/2021 22:12	0
6/4/2021 22:13	0
6/4/2021 22:14	0
6/4/2021 22:14	0
6/4/2021 22:14	0
6/4/2021 22:15	0
6/4/2021 22:15	0
6/4/2021 22:16	0
6/4/2021 22:17	0
6/4/2021 22:17	0
6/4/2021 22:17	0
6/4/2021 22:17	0
6/4/2021 22:18	0
6/4/2021 22:25	0
6/4/2021 22:27	0
6/4/2021 22:27	0
6/4/2021 22:28	0
6/4/2021 22:29	0
6/4/2021 22:30	0
6/4/2021 22:31	0
6/4/2021 22:32	0
6/4/2021 22:33	0
6/4/2021 22:34	0
6/4/2021 22:34	0
6/4/2021 22:34	0
6/4/2021 22:34	0
6/4/2021 22:35	0
6/4/2021 22:36	0
6/4/2021 22:37	0
6/4/2021 22:40	0
6/4/2021 22:42	0
6/4/2021 22:42	0
6/4/2021 22:44	0
6/4/2021 22:44	0
6/4/2021 22:44	0
6/4/2021 22:45	0
6/4/2021 22:45	0
6/4/2021 22:45	0
6/4/2021 22:45	0
6/4/2021 22:46	0
6/4/2021 22:46	0
6/4/2021 22:46	0
6/4/2021 22:47	0
6/4/2021 22:47	0
6/4/2021 22:47	0
6/4/2021 22:47	0
6/4/2021 22:48	0
6/4/2021 22:48	0
6/4/2021 22:49	0
6/4/2021 22:49	0
6/4/2021 22:51	0
6/4/2021 22:51	0
6/4/2021 22:52	0
6/4/2021 22:52	0
6/4/2021 22:53	0
6/4/2021 22:53	0
6/4/2021 22:53	0
6/4/2021 22:53	0
6/4/2021 22:54	0
6/4/2021 22:55	0
6/4/2021 22:58	0
6/4/2021 22:59	0
6/4/2021 22:59	0
6/4/2021 22:59	0
6/4/2021 22:59	0
6/4/2021 23:01	0
6/4/2021 23:01	0
6/4/2021 23:02	0
6/4/2021 23:03	0
6/4/2021 23:04	0
6/4/2021 23:05	0
6/4/2021 23:05	0
6/4/2021 23:05	0
6/4/2021 23:05	0
6/4/2021 23:06	0
6/4/2021 23:07	0
6/4/2021 23:08	0
6/4/2021 23:09	0
6/4/2021 23:10	0
6/4/2021 23:10	0
6/4/2021 23:11	0
6/4/2021 23:11	0
6/5/2021 0:38	0
6/5/2021 0:38	0
6/5/2021 0:55	0
6/5/2021 0:55	0
6/5/2021 0:56	0
6/5/2021 0:56	0
6/5/2021 0:56	0
6/5/2021 1:00	0
6/5/2021 1:00	0
6/5/2021 5:51	0
6/5/2021 20:57	0
6/6/2021 1:24	0
6/6/2021 1:24	0
6/6/2021 4:30	0
6/6/2021 4:30	0
6/6/2021 4:36	0
6/6/2021 4:36	0
6/6/2021 4:36	0
6/6/2021 4:36	0
6/6/2021 5:48	0
6/6/2021 5:48	0
6/6/2021 5:54	0
6/6/2021 5:54	0
6/6/2021 5:55	0
6/6/2021 5:55	0
6/6/2021 5:55	0
6/6/2021 5:56	0
6/6/2021 6:09	0
6/6/2021 6:10	0
6/6/2021 6:10	0
6/6/2021 6:11	0
6/6/2021 6:11	0
6/6/2021 8:15	0
6/6/2021 8:16	0
6/6/2021 12:31	0
6/6/2021 12:31	0
6/6/2021 13:59	0
6/6/2021 13:59	0
6/6/2021 14:00	0
6/6/2021 14:00	0
6/6/2021 20:13	0
6/6/2021 20:15	0
6/6/2021 20:15	0
6/6/2021 20:22	0
6/6/2021 20:22	0
6/7/2021 0:49	0
6/7/2021 0:50	0
6/7/2021 4:55	0
6/7/2021 4:55	0
6/7/2021 4:55	0
6/7/2021 4:55	0
6/7/2021 4:55	0
6/7/2021 5:25	0
6/7/2021 5:25	0
6/7/2021 5:26	0
6/7/2021 5:26	0
6/7/2021 5:47	0
6/7/2021 5:47	0
6/7/2021 5:56	0
6/7/2021 5:56	0
6/7/2021 6:18	0
6/7/2021 6:18	0
6/7/2021 6:29	0
6/7/2021 6:29	0
6/7/2021 6:30	0
6/7/2021 6:30	0
6/7/2021 6:35	0
6/7/2021 6:35	0
6/7/2021 7:15	0
6/7/2021 7:16	0
6/7/2021 7:16	0
6/7/2021 7:16	0
6/7/2021 7:54	0
6/7/2021 7:55	0
6/7/2021 7:58	0
6/7/2021 7:58	0
6/7/2021 8:13	0
6/7/2021 8:13	0
6/7/2021 8:37	0
6/7/2021 8:37	0
6/7/2021 8:37	0
6/7/2021 8:37	0
6/7/2021 8:43	0
6/7/2021 8:43	0
6/7/2021 8:44	0
6/7/2021 8:44	0
6/7/2021 8:48	0
6/7/2021 8:48	0
6/7/2021 8:55	0
6/7/2021 8:55	0
6/7/2021 9:02	0
6/7/2021 9:02	0
6/7/2021 9:02	0
6/7/2021 9:02	0
6/7/2021 9:03	0
6/7/2021 9:03	0
6/7/2021 9:03	0
6/7/2021 9:05	0
6/7/2021 9:05	0
6/7/2021 9:06	0
6/7/2021 9:06	0
6/7/2021 9:07	0
6/7/2021 9:07	0
6/7/2021 9:09	0
6/7/2021 9:09	0
6/7/2021 9:13	0
6/7/2021 9:13	0
6/7/2021 9:14	0
6/7/2021 9:14	0
6/7/2021 9:25	0
6/7/2021 9:25	0
6/7/2021 9:29	0
6/7/2021 9:29	0
6/7/2021 9:37	0
6/7/2021 9:38	0
6/7/2021 9:39	0
6/7/2021 9:41	0
6/7/2021 9:42	0
6/7/2021 9:42	0
6/7/2021 9:43	0
6/7/2021 9:44	0
6/7/2021 9:44	0

so two things occur to me. First: have you tried importing a pre-built mmsql dashboard and inspected their queries? Using pre-defined dashboard can save you many many hours.

Second, tracking state over time is what the new state timeline does very well:

https://play.grafana.org/d/YI95GyqMz/1-new-features-in-v8-0?orgId=1

Third, I think you will need to use global variables to achieve the effect that you want. Particularly $time_filter, which works with sql datasources:

then you could do something like this:

SELECT "total" FROM "State ONLINE" WHERE ("servername" =~ /$Instance$/ AND "type" = 'Database properties') AND $timeFilter

This topic was automatically closed after 365 days. New replies are no longer allowed.