Difference between revisions of "LogQL"

From wikieduonline
Jump to navigation Jump to search
(Created page with "{{Draft}} == See also == * {{Loki}} * {{Grafana}} Category:Logging")
 
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
  
 +
 +
[[logcli]]
 +
 +
 +
Get top 10 applications by highest log throughput:
 +
topk(10,sum(rate({region=”us-east1"}[5m]) by (name))
 +
Get the count of logs during the last 5 minutes by level:
 +
sum(count_over_time({job=”mysql”}[5m])) by (level)
 +
Get the rate of HTTP GET requests from nginx logs:
 +
avg(rate(({job=”nginx”} |= “GET”)[10s])) by (region)
  
  
 
== See also ==
 
== See also ==
 
* {{Loki}}
 
* {{Loki}}
 +
* {{grep}}
 
* {{Grafana}}
 
* {{Grafana}}
  
 
[[Category:Logging]]
 
[[Category:Logging]]

Latest revision as of 17:40, 23 November 2020

This article is a Draft. Help us to complete it.


logcli


Get top 10 applications by highest log throughput:

topk(10,sum(rate({region=”us-east1"}[5m]) by (name))

Get the count of logs during the last 5 minutes by level:

sum(count_over_time({job=”mysql”}[5m])) by (level)

Get the rate of HTTP GET requests from nginx logs:

avg(rate(({job=”nginx”} |= “GET”)[10s])) by (region)


See also[edit]

Advertising: