Skip to content

Instantly share code, notes, and snippets.

@kerbelp
Last active December 20, 2016 12:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kerbelp/5507b18a0efbee20d12471e451fee97a to your computer and use it in GitHub Desktop.
Save kerbelp/5507b18a0efbee20d12471e451fee97a to your computer and use it in GitHub Desktop.
CREATE EXTERNAL TABLE IF NOT EXISTS elb_logs_raw (
request_timestamp string,
elb_name string,
request_ip string,
request_port int,
backend_ip string,
backend_port int,
request_processing_time double,
backend_processing_time double,
client_response_time double,
elb_response_code string,
backend_response_code string,
received_bytes bigint,
sent_bytes bigint,
request_verb string,
url string,
protocol string,
user_agent string,
ssl_cipher string,
ssl_protocol 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.-]*)$' )
LOCATION 's3://atom-elb-access-logs/AWSLogs/elasticloadbalancing/us-east-1/';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment