UNPKG

nsyslog

Version:

Modular new generation log agent. Reads, transform, aggregate, correlate and send logs from sources to destinations

75 lines (70 loc) 1.66 kB
{ "config" : { "datadir" : "/tmp/nsyslog", "input" : {"maxPending" : 1000}, "buffer" : {"maxPending": 1000}, "processor" : {"maxPending": 1000}, "transporter" : {"maxPending": 1000} }, "description" : [ "This configuration shows the use of mongodb, both as transporter and as an input", "First, we read log files from log collections, and sends them to a dynamic", "collection based on read timestamp", "Input uses a field named 'line' as a watermark" ], "inputs" : { "mongoin" : { "type" : "mongo", "config" : { "url" : "mongodb://localhost/nsyslog", "collection" : ["/logs.*/"], "query" : {"line":{"$gt":"${line}"}}, "sort" : {"line":1}, "watermark" : {"line":0}, "maxCursors" : 10 } } }, "processors" : { "timestamp" : { "type" : "timestamp", "config" : { "output" : "ts" } }, "date" : { "type" : "dateformat", "config" : { "input" : "${ts}", "output" : "date", "format" : "YYYYMMDD" } } }, "transporters" : { "logger" : { "type" : "console", "config" : {"format" : "${JSON}", "level" : "log"} }, "mongoout" : { "type" : "mongo", "config" : { "url" : "mongodb://localhost/nsyslog", "collection" : "out_${date}", "format" : { "input" : "${input}", "timestamp" : "${ts}", "message" : "${originalMessage}" }, "retry" : true, "maxRetry" : 5 } }, "null" : { "type" : "null" } }, "flows" : [ {"from":"*", "processors":["timestamp","date"], "transporters":["logger","mongoout"],"mode":"parallel"} ] }