slog
Version:
Log parser with configurable column processors.
20 lines (14 loc) • 315 B
JavaScript
// @distribution
//
// Counts the occurrences of distinct values in a column.
//
// The first time this is called output will be undefined
//
output = output || {};
// Ensure we have initialized the slot for the datapoint
//
if(output[input] === void 0) {
output[input] = 0;
}
output[input]++;
return output;