Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

graphite, use regular expressions to select the target, or an alternative

Tags:

graphite

I need to query graphite for data with a few different targets; currently I do a http query for each target. for instance:

http://graphite.example.com/render/?format=json&until=now&from=-1min&target=servers.srv231.solr.hits
http://graphite.example.com/render/?format=json&until=now&from=-1min&target=servers.srv325.solr.hits

Is there a way to get the two results in one query? I could do as follows:

http://graphite.example.com/render/?format=json&until=now&from=-1min&target=servers.srv*.solr.hits

but I would get a lot of other data that I am not interested in.

i've tried using regular expressions, like this, but it does not work:

http://graphite.example.com/render/?format=json&until=now&from=-1min&target=servers.srv(231|325).solr.hits

In the doc, they do not mention regular expressions nor wildcards, but they use wildcards in the examples. http://graphite.readthedocs.org/en/0.9.10/render_api.html

is there a way to achieve my goal?

like image 294
David Portabella Avatar asked Feb 16 '23 13:02

David Portabella


1 Answers

Graphite uses globs not regular expressions for matching. So your query would be:

http://graphite.example.com/render/?format=json&until=now&from=-1min&target=servers.srv{231,325}.solr.hits
like image 157
Dave Wongillies Avatar answered May 10 '23 15:05

Dave Wongillies