Open source tool for parsing and charting logs files
//example code
//logcharting.create(options);
logcharting.create({
expDate: /\[(\d{2}[./-]\w{3}[./-]\d{4})(.*)]/,
expMetric: /HTTP\/1.0"\s(\d+)/,
file: "access.log",
canvas: ".log-charting"
});
#!bin/bash
$ npm install log-charting.js
<!-- Include js -->
<script src="./node_modules/log-charting.js/dist/log-charting.min.js"></script>
<!-- Add canvas tag -->
<canvas class="log-charting"></canvas>
//execute js code
logcharting.create({
expDate: /\[(\d{2}[./-]\w{3}[./-]\d{4})(.*)]/,
expMetric: /HTTP\/1.0"\s(\d+)/,
file: "access.log",
canvas: ".log-charting"
});
Option | Description |
---|---|
expDate | Regular expression to get the date data from log file |
expMetric | Regular expression to get the Metrics data from log file |
file | Local log file path |
canvas | Canvas selector |