Help us understand the problem. What is going on with this article?

AthenaでELBのログを解析できるようにする

More than 1 year has passed since last update.

各所に同じようなコンテンツがあるのですが、AWS側でログフォーマットが変わったりで新旧のログを見ようと思うとうまく見れなかったので作りました。

参考にしたサイトは以下になります。
Athenaでパースできるログフォーマットを指定する
Amazon Athena RegexSerDe を利用して ALB ログを探索する(2018年8月版)

CREATE EXTERNAL TABLE IF NOT EXISTS elb_logs (
type string,
request_timestamp string,
elb_name string,
client_addrport string,
client_ip string,
client_port int,
target_addrport string,
target_ip string,
target_port int,
request_processing_time decimal(8,6),
target_processing_time decimal(8,6),
response_processing_time decimal(8,6),
elb_status_code string,
target_status_code string,
received_bytes int,
sent_bytes int,
request_verb string,
url string,
protocol string,
user_agent string,
ssl_cipher string,
ssl_protocol string,
target_group_arn string,
trace_id string
)
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.RegexSerDe'
WITH SERDEPROPERTIES (
  'serialization.format' = '1',
  'input.regex' = '([^ ]*) ([^ ]*) ([^ ]*) (([^ ]*):([^ ]*)|-) (([^ ]*):([^ ]*)|-) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) \"([^ ]*) ([^ ]*) ([^"]*)\" \"([^\"]*)\" ([^ ]*) ([^ ]*) ([^ ]*) \"([^\"]*)[ ]*\".*$'
) 
LOCATION 's3://<バケット名>/AWSLogs/082750195178/elasticloadbalancing/<リージョン名>/'
TBLPROPERTIES ('has_encrypted_data'='false');
crosspointst
メーカーでIT裏方しています。 フロントエンド弱いです。どちらかというとインフラ系が強いです。 IoT, BIツール(主にTableau), Redmine等々に携わっています。
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした