code: func NewLogstashOutput(w io.Writer) Output {
  	return OutputFunc(func(fields map[string]interface{}) error {
  		lsf := map[string]interface{}{
  			"@version": 1,
  		}
  		for k, v := range fields {
  			switch k {
  			case KeyTime:
  				k = "@timestamp"
  			case KeyLevel:
  				if s, ok := v.(string); ok {
  					v = strings.ToUpper(s)
  				}
  			}
  			if t, ok := v.(time.Time); ok {
  				lsf[k] = t.Format(time.RFC3339)
  			} else {
  				lsf[k] = v
  			}
  		}
  		b, err := json.Marshal(lsf)
  		if err != nil {
  			return err
  		}
  		_, err = w.Write(b)
  		return err
  	})
  }
docs: // NewLogstashOutput returns an output to generate logstash friendly JSON format.