func (e *EventData) WriteRFC5424(w io.Writer) (int64, error) {
	var eJSONBytes []byte
	var err error
	if eJSONBytes, err = json.Marshal(e); err != nil {
		return 0, fmt.Errorf("failed to json serialize event: %v", err)
	}
	msg := rfc5424.Message{
		Priority:  rfc5424.Daemon,
		Timestamp: e.Event.LastTimestamp.Time,
		Hostname:  e.Event.Source.Host,
		AppName:   e.Event.Source.Component,
		Message:   eJSONBytes,
	}
	return msg.WriteTo(w)
}
WriteRFC5424 writes the current event data to the given io.Writer using
RFC5424 (syslog over TCP) syntax.
package sinks
import (
	"encoding/json"
	"fmt"
	"io"
	"github.com/crewjam/rfc5424"
	"github.com/json-iterator/go"
	"github.com/json-iterator/go/extra"
	"k8s.io/api/core/v1"
	"github.com/nytlabs/gojsonexplode"
)
type EventData struct {
	Verb     string    `json:"verb"`
	Event    *v1.Event `json:"event"`
	OldEvent *v1.Event `json:"old_event,omitempty"`
}
func NewEventData(eNew *v1.Event, eOld *v1.Event) EventData {
	var eData EventData
	if eOld == nil {
		eData = EventData{
			Verb:  "ADDED",
			Event: eNew,
		}
	} else {
		eData = EventData{
			Verb:     "UPDATED",
			Event:    eNew,
			OldEvent: eOld,
		}
	}
	return eData
}