zisopoulos.com | Logflare | Cloudflare, Vercel & Elixir Logging

PHOTO EMBED

Fri Jun 18 2021 02:48:12 GMT+0000 (UTC)

Saved by @admariner

SELECT
  (
    `5518_prod`.LF_TIMESTAMP_TRUNC(t0.timestamp, 'MINUTE')
  ) as timestamp,
  COUNTIF(
    f2.status_code <= 99
    OR f2.status_code >= 601
    OR f2.status_code IS NULL
  ) as other,
  COUNTIF(
    f2.status_code BETWEEN 100
    AND 199
  ) as status_1xx,
  COUNTIF(
    f2.status_code BETWEEN 200
    AND 299
  ) as status_2xx,
  COUNTIF(
    f2.status_code BETWEEN 300
    AND 399
  ) as status_3xx,
  COUNTIF(
    f2.status_code BETWEEN 400
    AND 499
  ) as status_4xx,
  COUNTIF(
    f2.status_code BETWEEN 500
    AND 599
  ) as status_5xx,
  COUNT(t0.timestamp) as total
FROM
  `logflare-232118`.5518_prod.2541028b_95d6_4708_9d3d_f37af0e528ec AS t0
  INNER JOIN UNNEST(t0.metadata) AS f1 ON TRUE
  INNER JOIN UNNEST(f1.response) AS f2 ON TRUE
WHERE
  (
    t0.timestamp >= (
      `5518_prod`.LF_TIMESTAMP_SUB('2021-06-18 02:46:45.705709Z', 120, 'MINUTE')
    )
  )
  AND (REGEXP_CONTAINS(t0.event_message, '500'))
GROUP BY
  1
ORDER BY
  1 DESC
LIMIT
  120
content_copyCOPY

https://logflare.app/sources/12235/search?querystring