2.0.0 • Published 9 years ago

cloudflare-to-apache v2.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

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.

Build Status

Dependency Status

2.0.0

9 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.0

9 years ago

1.0.0

9 years ago