as you can see, i have logs in my query.{node=“tcampus-reception”}
but when i use unwrap to handle the label which it contains in my query, it shows syntax error: unexpected unwrap
so what is unwrap use for?do i use in wrong way?
as you can see, i have logs in my query.{node=“tcampus-reception”}
unwrap
is for extracting labels to be used as values for metric query.
What exactly are you looking to achieve?
thanks for you reply, i want to get the minimum id value。if could i want to get the minimum id’s origin log.
Then you’d probably want something like this (keep in mind in order to use unwrap your id
field must be numerical):
min_over_time({SELECT} | unwrap "id" [$__interval])
how to understand min_over_time?In this case, means the minimum id of all logs in each giving time interval?
my search result has more than one logs in each giving time interval, i’m confuse
Metric query will return one series per unique set of labels. If you are looking for a particular set of labels then you would want to aggregate it by the label you want:
sum by (label) (min_over_time({...} | ...))