Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经开始将 traefik 访问日志(以 JSON 格式)发送到 Grafana Loki,并希望可视化前 3 个 ClientHost。这是我为此编写的 LogQL,但它返回所选时间范围内的所有 ClientHost,而不仅仅是前 3 个。我错过了什么?
topk(3, sum by (ClientHost)(count_over_time({filename="/var/log/traefik/access-json.log"}|json[5m])))
您在 Grafana 上使用“探索”吗?不要忘记选择以下选项:
Query type = Instant