cloudflare-to-apache

2.0.0 • Public • Published

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

Package Sidebar

Install

npm i cloudflare-to-apache

Weekly Downloads

1

Version

2.0.0

License

MIT

Last publish

Collaborators

  • lloydwatkin