· 9 years ago · Dec 20, 2016, 12:35 PM
1CREATE EXTERNAL TABLE IF NOT EXISTS elb_logs_raw (
2 request_timestamp string,
3 elb_name string,
4 request_ip string,
5 request_port int,
6 backend_ip string,
7 backend_port int,
8 request_processing_time double,
9 backend_processing_time double,
10 client_response_time double,
11 elb_response_code string,
12 backend_response_code string,
13 received_bytes bigint,
14 sent_bytes bigint,
15 request_verb string,
16 url string,
17 protocol string,
18 user_agent string,
19 ssl_cipher string,
20 ssl_protocol string
21)
22ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.RegexSerDe'
23WITH SERDEPROPERTIES (
24 'serialization.format' = '1','input.regex' = '([^ ]*) ([^ ]*) ([^ ]*):([0-9]*) ([^ ]*):([0-9]*) ([.0-9]*) ([.0-9]*) ([.0-9]*) (-|[0-9]*) (-|[0-9]*) ([-0-9]*) ([-0-9]*) \\\"([^ ]*) ([^ ]*) (- |[^ ]*)\\\" (\"[^\"]*\") ([A-Z0-9-]+) ([A-Za-z0-9.-]*)$' )
25 LOCATION 's3://atom-elb-access-logs/AWSLogs/elasticloadbalancing/us-east-1/';