· 8 years ago · Jun 18, 2018, 12:42 AM
1CREATE EXTERNAL TABLE IF NOT EXISTS alb_logs (
2 type string,
3 time 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 request_url string,
18 request_proto string,
19 user_agent string,
20 ssl_cipher string,
21 ssl_protocol string,
22 target_group_arn string,
23 trace_id string,
24 domain_name string,
25 chosen_cert_arn string,
26 matched_rule_priority string,
27 request_creation_time string,
28 actions_executed string
29 )
30ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.RegexSerDe'
31WITH SERDEPROPERTIES (
32'serialization.format' = '1',
33'input.regex' =
34'([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*):([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.-]*) ([^ ]*) \"([^\"]*)\" \"([^\"]*)\" \"([^\"]*)\" ([-.0-9]*) ([^ ]*) \"([^\"]*)\"' )
35LOCATION 's3://bucket/logs/path/';