Hi! I am using timelion with this code .es(index = measurements, metric = max:value, split = id:4, q = "bar").label(regex = '.*FOO-(.*)', label = '$1 Consumption').
The thing is, I have a column with structure "FOO-BAR (some number)". So, I am using regex in order to match entities in that column and put them as first argument in label. I am expecting something like this in my labels BAR1 Consumption, BAR2 Consumption and etc. But instead, I get following: BAR1 > max(value) Consumption, BAR2 > max(value) Consumption
Is it the way it supposed to work? If I label graphs already why I have also my aggregation there?
the regex is actually execute against the legend as is at this point. Meaning you shouldn't make your regex match against the field value, but get rid of the legend function, look how the legend looks, and make your regex match this legend and extract what it needs.
this is my original query without applying the regex part. .es(index = measurements, metric = max:value, split = meter_id:4, q = "1\-0\:1\.8\.0\*255").derivative(). This is what I get in my labels:
q:1-0:1.8.0*255 > meter_id:CUC-DEMO6 > max(value)
and this is my query with regex. .es(index = measurements, metric = max:value, split = meter_id:4, q = "1\-0\:1\.8\.0\*255").derivative().label(regex = '.*CUC-(.*)', label = '$1 Consumption'). This is what I get in response in my label:
DEMO6 > max(value) Consumption
My question would be, is this the normal behavior? If yes, how I can "make" > max(value) part disappear?
Try not to match the > sign in your capture group: .*CUC-([^>]*).*, because currently your capture group matches the whole rest of the string (including the aggregation part).
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.