From c09822692eb5341a5e286a5cb97e0ba6d28d1490 Mon Sep 17 00:00:00 2001 From: Jordan Sissel Date: Tue, 2 Jul 2013 21:17:22 -0700 Subject: [PATCH] - add 'host' field --- publisher1.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/publisher1.go b/publisher1.go index f87034e..202135e 100644 --- a/publisher1.go +++ b/publisher1.go @@ -20,7 +20,6 @@ var hostname string func init() { log.Printf("publisher init\n") hostname, _ = os.Hostname() - } func Publishv1(input chan []*FileEvent, @@ -168,9 +167,10 @@ func writeDataFrame(event *FileEvent, sequence uint32, output io.Writer) { // sequence number binary.Write(output, binary.BigEndian, uint32(sequence)) // 'pair' count - binary.Write(output, binary.BigEndian, uint32(len(*event.Fields) + 3)) + binary.Write(output, binary.BigEndian, uint32(len(*event.Fields) + 4)) writeKV("file", *event.Source, output) + writeKV("host", hostname, output) writeKV("offset", strconv.FormatInt(event.Offset, 10), output) writeKV("line", *event.Text, output) for k, v := range(*event.Fields) { -- GitLab