nlf / bucker

A simple logging library for node.js
82 stars 28 forks source link

add support for logstash's event json log format #6

Closed bear closed 11 years ago

bear commented 11 years ago

logstash has an input file type called logstash_event which is nothing but json with set field names as a single line

for example, this is what I have nginx outputting for access logs:

{ "@timestamp": "$time_iso8601", "@source": "$", " "@fields": { "domain": "$host", "url": "$uri", "client": "$remote_addr", "user": "$remote_user", "size": "$body_bytes_sent", "responsetime": "$request_time", "upstreamtime": "$upstream_response_time", "status": "$status", "request": "$request", "method": "$request_method", "http_referrer": "$http_referer", "http_user_agent": "$http_user_agent" } }

a bucker non-access log would look like:

{ "@timestamp": "$time_iso8601", "@source": "$appname", "@message": "the log message", "@fields": { "@whatever_works": "" } }

bear commented 11 years ago

see https://github.com/logstash/logstash/wiki/logstash's-internal-message-format for other details

nlf commented 11 years ago

done, we now support logstash over both UDP and redis pubsub