Skip to content

Instantly share code, notes, and snippets.

@onastavchuk
Created November 17, 2017 12:36
Show Gist options
  • Save onastavchuk/adab6959a3583a5fa1cc68000311c50b to your computer and use it in GitHub Desktop.
Save onastavchuk/adab6959a3583a5fa1cc68000311c50b to your computer and use it in GitHub Desktop.
SELECT A AS host,
CASE WHEN length(substr(D, 2, 20)) > 0 THEN substr(D, 2, 20) ELSE NULL END AS request_time,
F AS request,
CONVERT_TO_INTEGER(G, 1, 0, 0) AS status,
CONVERT_TO_INTEGER(H, 1, 0, 0) AS bytes
FROM apache-logs.nasa
WHERE is_convertible_data(G, 1, 'INTEGER')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment