Created
August 10, 2017 22:31
-
-
Save phsantiago/4984304929aaf0b4af24ab07339db741 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
CREATE EXTERNAL TABLE IF NOT EXISTS Accesslogs( | |
BucketOwner string, | |
Bucket string, | |
RequestDateTime string, | |
RemoteIP string, | |
Requester string, | |
RequestID string, | |
Operation string, | |
Key string, | |
RequestURI_operation string, | |
RequestURI_key string, | |
RequestURI_httpProtoversion string, | |
HTTPstatus string, | |
ErrorCode string, | |
BytesSent string, | |
ObjectSize string, | |
TotalTime string, | |
TurnAroundTime string, | |
Referrer string, | |
UserAgent string, | |
VersionId string) | |
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.RegexSerDe' | |
WITH SERDEPROPERTIES ( | |
'serialization.format' = '1', | |
'input.regex' = '([^ ]*) ([^ ]*) \\[(.*?)\\] ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) \\\"([^ ]*) ([^ ]*) (- |[^ ]*)\\\" (-|[0-9]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) (\"[^\"]*\") ([^ ]*)$' | |
) LOCATION 's3://viavarejo-mvp/logs/' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment