I got a log that has format like this:
{"date":"2020-10-24 12:16:48","function":"login","status_code":200,"time_taken":"0.048"}
Every time a function is called, it is logged. Now, I would like to query for all the lines that have time_taken more than or equal to, for example, 0.1 .
Right now, I am doing this using the following LogQL query to obtain any log that has time_taken more than or equal to 0.1:
count_over_time({job="myapplog"} |~ "time_taken\":\"[1-9].[0-9]"[1m])
This works for time_taken that has value between 0.1 to 9.9, which means all the time above 10 seconds will not appear in this case.
Before complicating myself further with regular expression, does Loki support numerical comparison in this case? Or must I use regular expression only? If so, what would be the preferred regular expression for this case?