This takes a apache log, parses it and returns it as buffer
This is an apache parser that takes a line of an apache log and returns it in json line by line through the stream.
npm install --save apachelog-stream
// read a filevar fs =// liner stream// apachelog-streamvar ApacheStream =var logStream =var input = fs // can be from a stream such as knox or requestvar output = inputoutput
Takes an array for strings of what you want it to output. Ex: ['ipAddress', 'host']. This needs to be in the same order of the log that it is parsing. THIS WILL OVERRIDE LOGTYPE! So include all the fields that you are wanting.