Extremely flexible data reformatter using portluck. Can be used to flexibly record logs from various applications and reformat and record them in a central place.
Gobbler only handles passing data along and does not support displaying data, except for the built-in websocket writer. You must use another service, like Logstash/Kibana, to display the data. Gobbler will handle all the reformatting and ratelimiting and forward the data to the other service.
Most configuration changes can be made without restarting and you can write your own writers/formatters that work alongside the built-in ones.
node run.js [options] start
node run.js --help
Command-line options override the config.json options.
See config.json.example for an example config.
String that identifies the gobbler instance when using the jsonWrap
writer.
Port to listen on. Default is 80
IP to listen on. Default is 0.0.0.0
An array of writers to send the data to after formatting is complete. Data is buffered if and only if ALL writers are disconnected.
An array of formatters to rewrite/mangle the data before sending it to the writers. Each formatter is run
in the order specified in the config. If any formatter throws an exception the message is dropped and an
error is logged and/or sent to the client, depending on the clientLogLevel
.
A hash of client rate limits. As of v0.1.0 the limits are only maintained PER child. This is intended to be fixed in a later version.
- persistentConns: limit of persistent connections allowed per IP. Any new connections will be dropped.
- messages: allowed number of messages per IP per
messagesTimeframe
- messagesTimeframe: timeframe, in seconds, for
messages
limit - logs: maximum number of generated logs allowed per IP per 5 minutes. Each formatter error or socket error triggers a log message and this limit controls how much a single IP can flood the log.
Controls how verbose you want to be with clients. Recommended production value is 0 and recommended dev value is 3.
- Any formatter/writer errors result in no response from gobbler
- Formatter/writer errors result in
invalid_payload\n
being sent to the client - In addition to 1, if a client is rate-limited they will receive
rate_limited\n
- Client will receive full error message and formatter/writer that threw the error
Hash of options to pass to portluck when making the server. See portluck documentation.
If set to true, this enables the heapdump command to capture heapdumps from the children.
node run.js [options] [command]
Hot-reload all the children. Reload doesn't reload the actual server (potluck instance) itself.
Hot-reload the config. If you added any new formatters or writers, calling this will set them up.
Restart the children. This will sever any connections that they had open.
Shutdown the server.
Get the status of the children.
Prints the persistent connection counts for each child. Can be used to send to a graphing service like Zabbix.
Assuming heapdump was enabled in your config, this command will cause all the children to create a heapdump.
By James Hartig