· 9 years ago · Dec 20, 2016, 08:00 PM
1CREATE EXTERNAL TABLE IF NOT EXISTS alb_logs (
2 type string,
3 timestamp string,
4 elb string,
5 client_ip string,
6 client_port int,
7 target_ip string,
8 target_port int,
9 request_processing_time double,
10 target_processing_time double,
11 response_processing_time double,
12 elb_status_code string,
13 target_status_code string,
14 received_bytes bigint,
15 sent_bytes bigint,
16 request_verb string,
17 url string,
18 protocol string,
19 user_agent string,
20 ssl_cipher string,
21 ssl_protocol string,
22 target_group_arn string,
23 trace_id string )
24ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.RegexSerDe'
25WITH SERDEPROPERTIES (
26 '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.-]*) ([^ ]*) ([^ ]*)$' )
27LOCATION 's3://somebucket/AWSLogs/';