· 8 years ago · Apr 20, 2018, 06:52 PM
1CREATE EXTERNAL TABLE IF NOT EXISTS {db_name}.{table_name} (
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 )
27 PARTITIONED BY (
28 `year` string,
29 `month` string,
30 `day` string)
31ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.RegexSerDe'
32WITH SERDEPROPERTIES (
33'serialization.format' = '1',
34'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.-]*) ([^ ]*) (.*) (.*) (.*)' )
35LOCATION '{log_location}'