Skip to content

Commit

Permalink
Revert "remove sql create table as this manual step is no longer needed"
Browse files Browse the repository at this point in the history
This reverts commit 2fe90ed.
  • Loading branch information
robertsweetman committed Jan 3, 2024
1 parent 2fe90ed commit 12f9aec
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions templates/create_table.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
CREATE EXTERNAL TABLE IF NOT EXISTS ${database}.lb_logs (
type string,
time string,
elb string,
client_ip string,
client_port int,
target_ip string,
target_port int,
request_processing_time double,
target_processing_time double,
response_processing_time double,
elb_status_code string,
target_status_code string,
received_bytes bigint,
sent_bytes bigint,
request_verb string,
request_url string,
request_proto string,
user_agent string,
ssl_cipher string,
ssl_protocol string,
target_group_arn string,
trace_id string,
domain_name string,
chosen_cert_arn string,
matched_rule_priority string,
request_creation_time string,
actions_executed string,
redirect_url string,
new_field string
)
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.RegexSerDe'
WITH SERDEPROPERTIES (
'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.-]*) ([^ ]*) \"([^\"]*)\" \"([^\"]*)\" \"([^\"]*)\" ([-.0-9]*) ([^ ]*) \"([^\"]*)\"($| \"[^ ]*\")(.*)')
LOCATION 's3://${bucket}/${application_name}/AWSLogs/${account_id}/elasticloadbalancing/${region}/';

0 comments on commit 12f9aec

Please sign in to comment.