Created
July 24, 2019 21:55
-
-
Save hamletbatista/e652f69ca9b23e43b7891b803ffe2d86 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://regex101.com/r/ElmF2y/2/ | |
p= r'^(\S+) \S+ \S+ \[([^\]]+)\] "[A-Z]+\s([^\s]+) [^"]+" (\d+) \d+ "[^"]*" "([^"]*)"$' | |
#example CSV output | |
#ip,date,url,status_code,ua | |
#66.249.69.196,30/Jun/2019:08:05:31 -0400,/Crawl-Your-Ecommerce-Site-with-Python-Scrapy-,301,Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) | |
#66.249.69.196,30/Jun/2019:08:05:32 -0400,/category/design-development,200,Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) | |
#66.249.69.196,30/Jun/2019:08:05:32 -0400,/Crawl-Your-Ecommerce-Site-with-Python-Scrapy,200,Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html) | |
#66.249.69.196,30/Jun/2019:08:05:38 -0400,/wp-content/uploads/2015/05/practical-ecommerce-icon.png-144,404,Googlebot-Image/1.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment