Skip to content
This repository was archived by the owner on Aug 8, 2024. It is now read-only.

Conversation

@oldillusion
Copy link

Fixes for IP address parsing, extract_inner_value strings and additional entry for extension variables

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 3cf2f76 on OlfactoryNinja:master into 1cc8940 on rory:master.

@amandasaurus
Copy link
Owner

Thanks for your contributions. I'm sorry if I missed some bits. Would you mind adding some unittests that cover your changes? So that I can get an idea of what you've fixed?

Or, alternatively, could you give me some samples of lines that were not parsed correctly in the old way, but (with your changes) are parsed correctly?

@oldillusion
Copy link
Author

No need for apologies mate, I figure you just hadn't seen log files with a higher complexity to them, so wouldn't know the parts that were missed. Awesome library, btw.

I have no experience of doing unit tests in Python, but here's the test code I've been working with that necessitated my changes:

parser = apache_log_parser.make_parser('%h %{remote}p %v %{local}p %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %P %D %{number}n %{SSL_PROTOCOL}x %{SSL_CIPHER}x %k %{UNIQUE_ID}e ')
data = parser('127.0.0.1 50153 mysite.co.uk 443 [28/Nov/2014:10:03:40 +0000] "GET /mypage/this/that?stuff=all HTTP/1.1" 200 5129 "-" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36" 18572 363701 0 TLSv1.01 MY-CYPHER 0 VHhIfKwQGCMAAEiMUIAAAAF ')
pp.pprint(data)

parser = apache_log_parser.make_parser('%A %V %p %P %a \"%r\" \"%{main_call}n\" %{some_time}t %b %>s %D %{UNIQUE_ID}e ')
data = parser('127.0.0.1 othersite 80 25572 192.168.1.100 "GET /Class/method/ HTTP/1.1" "-" 20141128155031 2266 200 10991 VHiZx6wQGCMAAEiBE8kAAAAA:VHiZx6wQGiMAAGPkBnMAAAAH:VHiZx6wQGiMAAGPkBnMAAAAH ')
pp.pprint(data)

@amandasaurus amandasaurus merged commit 3cf2f76 into amandasaurus:master Jan 2, 2015
@amandasaurus
Copy link
Owner

Thanks! This is released at 1.4.1 now

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants