masato25 / grafana-openfalcon-datasource

openfalcon plugin for grafana
MIT License
6 stars 73 forks source link

templating里query不支持正则表达式吗 #4

Closed aioloszcy closed 7 years ago

aioloszcy commented 7 years ago

我的主机名test1,test2...,test9 query填写test([1-9]),发现没有找到主机。 啥问题?

masato25 commented 7 years ago

現在官方版本的作法是 query 會去問 dashboard 的api去找出list https://github.com/open-falcon/dashboard/blob/master/rrd/model/endpoint.py#L23. 所以只有支援sql 的like作法. 這邊有一個我改寫過得query模組, 它可以支援正規表達的作法. 你可以嘗試看看 https://github.com/masato25/open_lambda_query test_regexp

masato25 commented 7 years ago

现在 open-falcon/falcon-plus api module裡面已经有自带 grafana api https://github.com/open-falcon/falcon-plus/blob/master/modules/api/app/controller/graph/graph_routes.go#L28

你可以搭配使用 github.com/open-falcon/grafana-openfalcon-datasource

你可以使用这个 这个支援正规表达式