Created
July 5, 2017 18:03
-
-
Save hectcastro/d8c39877f30057c5c130d1c38a39d0a6 to your computer and use it in GitHub Desktop.
A DDL to convert Papertrail logs into an AWS Athena table. Raw
This file contains hidden or 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
CREATE EXTERNAL TABLE IF NOT EXISTS cicero.papertrail ( | |
`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' = ' ' | |
) LOCATION 's3://cicero-logs/papertrail/' | |
TBLPROPERTIES ('has_encrypted_data'='false'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment