InfluxDB: Fix regular expression to parse aliases according to documentation (#41186) (#41190)

* Fix regular expression to parse aliases that start with either square brackets or dollar sign

* Fix lint

(cherry picked from commit 8a3e192e6a)

Co-authored-by: Dimitris Sotirakis <dimitrios.sotirakis@grafana.com>
This commit is contained in:
Grot (@grafanabot)
2021-11-02 13:53:37 +01:00
committed by GitHub
co-authored by Dimitris Sotirakis
parent c7cc9629f7
commit 9a2e14d3e5
2 changed files with 190 additions and 158 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ import (
type ResponseParser struct{}
var (
legendFormat = regexp.MustCompile(`\[\[([\@\/\w-]+)(\.[\@\/\w-]+)*\]\]*|(\$*([\@\w-]+?))*`)
legendFormat = regexp.MustCompile(`\[\[([\@\/\w-]+)(\.[\@\/\w-]+)*\]\]*|\$(\s*([\@\w-]+?))*`)
)
func (rp *ResponseParser) Parse(buf io.ReadCloser, query *Query) *backend.QueryDataResponse {