AWS Elastic Load Balancing ULM - Application アプリケーションのログとメトリクスの収集
AWS ELB ULM Application アプリケーションのメトリクスの収集
AWS Elastic Load Balancing のメトリクスを収集するには、以下の手順を実行します。
前提条件
AWS Elastic Load Balancing (ELB) Application アプリケーションを使用するには、事前に以下の手順を実行する必要があります。
- Amazon S3 バケットに、Sumo Logic へのアクセス権を与えます。
-
ログが、Amazon S3 バケットに配信されることを確認します。
AWS ELB ULM Application アプリケーションのログの収集
このステップでは、AWS Elastic Load Balancer ログを受信するように AWS Elastic Load Balancing Source を設定します。ステップ 3 で、Source タイプとして AWS Elastic Load Balancing を選択します。
ログ メッセージのサンプル
https 2017-11-20T22:05:36 long-bill-lb 77.222.19.149:41148 10.168.203.134:23662 0.000201 0.401924 0.772005 500 200 262 455 "GET https://elmagek.no-ip.org:443/json/v1/collector/histogram/100105037?startTimestamp=1405571270000&endTimestamp=1405574870000&bucketCount=60&_=1405574870206 HTTP/1.1" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4" DH-RSA-AES256-GCM-SHA384 TLSv1.2 arn:aws:elasticloadbalancing:us-west-2:104030218370:targetgroup/Prod-frontend/92e3199b1rc814fe9 "Root=1-58337364-23a8c76965a2ef7629b185e134"
クエリのサンプル
上位 10 件のクライアント IP
_sourceCategory=*alb*
| parse "* * * * * * * * * * * * \"*\" \"*\" * * * \"*\"" as type, datetime, ELB_Server, client, backend, request_processing_time, target_processing_time, response_processing_time, elb_status_code, target_status_code, received_bytes, sent_bytes, request,user_agent,ssl_cipher,ssl_protocol,target_group_arn,trace_id
| parse field=request "* *://*:*/* HTTP" as method, protocol, domain, server_port, uri
| parse field=target_group_arn "* " as target_group_arn nodrop
| parse field=client "*:*" as clientIP, port nodrop
| parse field=backend "*:*" as backendIP, backend_port nodrop
| fields - request, client, backend
| where (elb_status_code matches "5*") or (elb_status_code matches "4*")
| if (elb_status_code matches "5*",1,0) as elb_5XX
| if (elb_status_code matches "4*",1,0) as elb_4XX
| sum(elb_4XX) as elb_4XX, sum(elb_5XX) as elb_5XX by clientIP | (elb_4xx+elb_5XX) as elb_total
| filter clientIP in (order by elb_total | limit 20)
| order by elb_total | fields - elb_total