Quantcast
Channel: Piwik Forums - Support & Bugs
Viewing all articles
Browse latest Browse all 13117

Re: "Invalid date" when importing Apache logs

$
0
0
For anyone else with similar issues, I was able to circumvent mine by re-formatting my log files to look like:

03/May/2012:23:59:09 -0400 6341 - "GET /events/8/08/19/week HTTP/1.1" 301 205 66.249.71.175 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" - 0 281 - - - - - - - - -

The following command imported the logs in that format:

sudo python import_logs.py --url=http://127.0.1.1/piwik ../../../formatted_logs/hub-access.log-20120504 --idsite=1 --recorders=2 --enable-http-errors --enable-http-redirects --enable-static --enable-bots --log-format-regex='(?P<date>.*?:[\d+]*:[\d+]*:[\d+]*) (?P<timezone>\S+) (?P<pid>\d+) - "(?P<request>\S+) (?P<path>.*?) \S+" (?P<status>\d+) (?P<length>\d+) (?P<ip>[(\d\.)]+) "(?P<referer>.*?)" "(?P<user_agent>.*?)" (?P<protocol>.*?) (\d+) (\d+) (.*?) (?P<session>.*?) (.*?) (.*?) (.*?) (.*?) (.*?) (.*?) (.*?)(.*?)$' --debug --debug

Viewing all articles
Browse latest Browse all 13117

Trending Articles