See fecha for details of timestamp formats.
$ node index.js simple a b c
info: arguments: [ 'a', 'b', 'c', [length]: 3 ] {"0":"a","1":"b","2":"c","timestamp":"2018-08-29T12:26:14.844Z"}
See fecha for details of timestamp formats.
$ node index.js simple a b c
info: arguments: [ 'a', 'b', 'c', [length]: 3 ] {"0":"a","1":"b","2":"c","timestamp":"2018-08-29T12:26:14.844Z"}
| const { createLogger, format, transports } = require('winston'); | |
| let test = {}; | |
| test.simple = () => { | |
| const logger = createLogger({ | |
| format: format.simple(), | |
| transports: [new transports.Console()] | |
| }); | |
| logger.info('Hello world!'); |
| # See https://help.github.com/ignore-files/ for more about ignoring files. | |
| # dependencies | |
| /node_modules | |
| # testing | |
| /coverage | |
| # production | |
| /dist |
This gist is just a personal practice record of Logstash Multiple Pipelines.
The following summary assumes that
the PATH contains Logstash and Filebeat executables
and they run locally on localhost.
| def greedy_set_cover(universe, subsets, costs): | |
| covered = set() | |
| selection = [] | |
| cover_cost = 0 | |
| while (len(covered) < universe): | |
| # Cost effectiveness | |
| ce = [ float('inf') if len(uncovered) == 0 else (costs[i] / len(uncovered)) | |
| for i in range(len(subsets)) | |
| for uncovered in [subsets[i].difference(covered)] ] | |
| index = min(range(len(subsets)), key = lambda i: ce[i]) |
| #include <iostream> | |
| #include <iterator> | |
| #include <string> | |
| #include <sstream> | |
| #include <vector> | |
| #include <set> | |
| #include <algorithm> | |
| #include <numeric> | |
| #include <limits> | |
| #include <cassert> |
| # See https://help.github.com/ignore-files/ for more about ignoring files. | |
| # dependencies | |
| /node_modules | |
| # testing | |
| /coverage | |
| # production | |
| /dist |