Hello,
I have a table with the following schema:
mysql> desc alldata;
+------------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------------+-------------+------+-----+---------+-------+
| vtime | int(11) | NO | PRI | 0 | |
| hitrate | float(10,2) | YES | | NULL | |
| requests | int(11) | NO | | 0 | |
| errors | text | NO | | NULL | |
| cache_hits | int(11) | NO | | 0 | |
| rps | float(10,2) | NO | | 0.00 | |
| cps | float(10,2) | NO | | 0.00 | |
| mbps | float(10,2) | NO | | 0.00 | |
| bytes | int(11) | NO | | 0 | |
| attacks | text | YES | | NULL | |
| blacklist | text | YES | | NULL | |
| malicious | text | YES | | NULL | |
| cache_type | text | NO | | NULL | |
| geo_hits | text | NO | | NULL | |
| requests_matched | int(11) | NO | | 0 | |
| requests_total | int(11) | NO | | 0 | |
+------------------+-------------+------+-----+---------+-------+
16 rows in set (0.08 sec)
mysql>
I’m currently able to plot “requests” and “cache_hits” using:
SELECT
vtime AS "time",
requests,
cache_hits
FROM alldata
WHERE
$__unixEpochFilter(vtime)
ORDER BY vtime
However, when I add JSON_EXTRACT as shown below, nothing comes up for “Errors”:
SELECT
vtime AS "time",
requests,
cache_hits,
JSON_EXTRACT(errors,"$.total") AS "Errors"
FROM alldata
WHERE
$__unixEpochFilter(vtime)
ORDER BY vtime
If I manually run that query however, I get the expected results (numerical value of “Errors”)