generated from ministryofjustice/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "remove sql create table as this manual step is no longer needed"
This reverts commit 2fe90ed.
- Loading branch information
1 parent
2fe90ed
commit 12f9aec
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}/'; |