From 9abe7bc9a2ca30aa3804cfe4ff9ccc1e784ac5a8 Mon Sep 17 00:00:00 2001 From: lesensei Date: Tue, 26 Feb 2013 14:45:38 +0100 Subject: [PATCH 1/2] Add Amazon S3 log format to import_logs.py --- misc/log-analytics/import_logs.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/misc/log-analytics/import_logs.py b/misc/log-analytics/import_logs.py index 265a0685510..5d174499d02 100755 --- a/misc/log-analytics/import_logs.py +++ b/misc/log-analytics/import_logs.py @@ -160,6 +160,11 @@ def check_format(self, file): _NCSA_EXTENDED_LOG_FORMAT = (_COMMON_LOG_FORMAT + ' "(?P.*?)" "(?P.*?)"' ) +_S3_LOG_FORMAT = ( + '\S+ (?P\S+) \[(?P.*?) (?P.*?)\] (?P\S+) ' + '\S+ \S+ \S+ \S+ "\S+ (?P.*?) \S+" (?P\S+) \S+ (?P\S+) ' + '\S+ \S+ \S+ "(?P.*?)" "(?P.*?)" \S+' +) FORMATS = { 'common': RegexFormat('common', _COMMON_LOG_FORMAT), @@ -167,6 +172,7 @@ def check_format(self, file): 'ncsa_extended': RegexFormat('ncsa_extended', _NCSA_EXTENDED_LOG_FORMAT), 'common_complete': RegexFormat('common_complete', _HOST_PREFIX + _NCSA_EXTENDED_LOG_FORMAT), 'iis': IisFormat(), + 's3': RegexFormat('s3', _S3_LOG_FORMAT), } From edfeb60c277730c5e3646ca1730e1b5d2896f8c8 Mon Sep 17 00:00:00 2001 From: lesensei Date: Tue, 26 Feb 2013 23:54:22 +0100 Subject: [PATCH 2/2] Create sample log file using Amazon S3 log format --- misc/log-analytics/tests/logs/s3.log | 1 + 1 file changed, 1 insertion(+) create mode 100644 misc/log-analytics/tests/logs/s3.log diff --git a/misc/log-analytics/tests/logs/s3.log b/misc/log-analytics/tests/logs/s3.log new file mode 100644 index 00000000000..30d6841ef3b --- /dev/null +++ b/misc/log-analytics/tests/logs/s3.log @@ -0,0 +1 @@ +b659b576cff1e15e4c0313ff8930fba9f53e6794567f5c60dab3abf2f8dfb6cc www.example.com [10/Feb/2012:16:42:07 -0500] 1.2.3.4 - EB3502676500C6BE WEBSITE.GET.OBJECT index "GET /index HTTP/1.1" 200 - 368 368 10 9 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11"