Turn your logs into insights. This parser turns your log file into an array of objects.
To install this project you can run:
npm install
This project uses axios to fetch the log. The log is generated through the use of simple-node-logger.
Clone this repo and run npm run parser
https://github.com/radihuq/simple-node-logger-parser.git
The parser will remove the timestamps from the log and get rid of any empty lines. It will then JSON.parse
each object and push it to a master array.
-
Stringify your data:
const data = { cid: 'CjxJb2kYjmEgfossCKsI', uid: 'HlMric5ByjzJ', plugin: 1002, action: 'enter', timestamp: Date.now, _unique: 'wHYOWEyC61x3uUJMRrC3' }
-
Log your data:
log.info(JSON.stringify(data)); log.info(`[${data.cid}] (${data.uid}) ${data.plugin}: ${data.action}`);
Data input & calling simple-node-logger
Example of logged data
- Run this parser
The output will be an array of JavaScript objects.
Console while parser is running
Example of data output
This parser was created by Radiun Huq. You can reach him at:
Email: radi@mrhuq.com
Twitter: @radiunhuq