Created
February 15, 2017 02:34
-
-
Save sneak/0226bd3b71ef1b1c1e0f0b21d2641b4a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from https://medium.com/@dnorth98/analyzing-papertrail-logs-with-aws-athena-2427d3dd14f2#.nijavm26w | |
drop table papertrail.papertrail_logs; | |
CREATE EXTERNAL TABLE IF NOT EXISTS papertrail.papertrail_logs ( | |
`id` bigint, | |
`generated_at` string, | |
`received_at` string, | |
`source_id` bigint, | |
`source_name` string, | |
`source_ip` string, | |
`facility_name` string, | |
`severity_name` string, | |
`program` string, | |
`message` string | |
) | |
PARTITIONED BY (dt string) | |
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' | |
WITH SERDEPROPERTIES ( | |
'serialization.format' = ' ', | |
'field.delim' = "\t" | |
) LOCATION 's3://org-global-papertrail-archive/papertrail/logs/12345/'; | |
MSCK REPAIR TABLE papertrail_logs; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment