Skip to content

release v1.1.0

Latest
Compare
Choose a tag to compare
@boaz0 boaz0 released this 30 Oct 20:32
· 1 commit to master since this release
032848d

Move to RFC3339Nano as the default timestamp format in the logstash JSON.
In case you want to use RFC3339 (the old one) set the formatter in the following way:

logstashFieldMap := logrus.Fields{"@version": "1", "type": "log"}
fields := logrus.FieldMap{
	logrus.FieldKeyTime: "@timestamp",
	logrus.FieldKeyMsg:  "message",
}
logstashFmt := LogstashFormatter{
		Formatter: &logrus.JSONFormatter{
			FieldMap:        logstashFieldMap,
			TimestampFormat: time.RFC3339,
		},
		Fields: fields,
	}

logrustashHook := logrustash.New(conn, logstashFmt)