Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukeasrodgers/e9f269f25e049f72a79897af43d9d3e8 to your computer and use it in GitHub Desktop.
Save lukeasrodgers/e9f269f25e049f72a79897af43d9d3e8 to your computer and use it in GitHub Desktop.
Rollbar RQL Cheat Sheet
# List users by average and maximum session length.
SELECT person, max(client.runtime_ms), avg(client.runtime_ms)
FROM item_occurrence
GROUP BY 1
ORDER BY 2 DESC
# List active date ranges for each deploy.
SELECT client.javascript.code_version, min(timestamp), max(timestamp)
FROM item_occurrence
GROUP BY 1
# List top 100 user agent strings over last week
SELECT client.javascript.browser, count(*)
FROM item_occurrence
WHERE timestamp > unix_timestamp() - 60 * 60 * 24 * 7
GROUP BY 1
ORDER BY 2 DESC
# extract error message
SELECT body.message.body
FROM item_occurrence
WHERE item.counter = 6680
ORDER BY timestamp DESC
LIMIT 0, 20
# get 8 chars of error message after :
SELECT substring(body.message.body, locate(':', body.message.body), 8)
FROM item_occurrence
WHERE item.counter = 6680
ORDER BY timestamp DESC
LIMIT 0, 20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment