You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I have oftentimes encountered problems which would be solved by being able to use a function which would return the current time/date/timestamp, similar to prometheus' time() function. As an illustrative example, imagine a script which every day logs the timestamp it ran at, and I wanted to write a rule that would check this timestamp to ensure that it does in fact run everyday. In PromQL, this would look something like: (time() - my_script{output='timestamp'})/3600 < 24
However, I have found no functionality in LogQL which could do something similar. Describe the solution you'd like
As mentioned, I'd like LogQL to have a function like time() in PromQL.
Describe alternatives you've considered
I have tried a few things with __timestamp__, but that function seems to be built only for templating and not log/metric querying. Or maybe I am doing something wrong.
The text was updated successfully, but these errors were encountered:
+1, desperately need this. Allows us to alert on whether logs from a particular stream have appeared in the last x mins, which can't be done currently with absent_over_time (since that drops all labels)
Is your feature request related to a problem? Please describe.
I have oftentimes encountered problems which would be solved by being able to use a function which would return the current time/date/timestamp, similar to prometheus'
time()
function. As an illustrative example, imagine a script which every day logs the timestamp it ran at, and I wanted to write a rule that would check this timestamp to ensure that it does in fact run everyday. In PromQL, this would look something like:(time() - my_script{output='timestamp'})/3600 < 24
However, I have found no functionality in LogQL which could do something similar.
Describe the solution you'd like
As mentioned, I'd like LogQL to have a function like
time()
in PromQL.Describe alternatives you've considered
I have tried a few things with
__timestamp__
, but that function seems to be built only for templating and not log/metric querying. Or maybe I am doing something wrong.The text was updated successfully, but these errors were encountered: