cloudflare-to-apache
v2.0.0
Published
Script to convert Cloudflare log format to Apache log format
Downloads
5
Maintainers
Readme
Cloudflare to Apache
A small script to convert Cloudflare log format to match that of Apache. So you can import the logs into things like Piwik.
Cloudflare format
New format
host<space>IP<space>-<space>-<space>Request date<space>"Request"<space>Response code<space>Response time<space>"Referrer"<space>"User agent"<space>Hash
Old format
host<space>IP<space>Request timestamp<space>"Request"<space>Response code<space>Response time<space>"User Agent"<space>"Bot?"<space>"Referrer"
Apache format
IP - - [Request date string]<space>"Request"<space>Response code<space>-<space>"Referrer"<space>"User agent"
Usage
Simple
npm i -g cloudflare-to-apache
cloudflare-to-apache < inputFile > outputFile
To convert the older style format simply do:
cloudflare-to-apache -f old < inputFile > outputFile
Manual
node index < $inputFile > $outputFile
Outputting to a file
DEBUG=* node index apache.log < $inputFile
DEBUG=*
outputs debug information to the terminal.
Status
Tests currently run fine on Ubuntu (14.04) and OSX, not sure why they aren't running on travisci. Need to investigate and fix.