diff --git a/go.mod b/go.mod index 2bb6060c..331fb403 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/segmentio/go-loggly v0.5.0 github.com/sirupsen/logrus v1.8.1 - github.com/solarwinds/papertrail-go v0.0.0-20210309063915-0dce0e9dca34 + github.com/solarwinds/papertrail-go v0.0.0-20210601025410-ab261ef9e67e github.com/spf13/pflag v1.0.3 // indirect golang.org/x/net v0.0.0-20201021035429-f5854403a974 // indirect golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 // indirect diff --git a/go.sum b/go.sum index 8a0cd5c0..0e5d0183 100644 --- a/go.sum +++ b/go.sum @@ -138,12 +138,11 @@ github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdh github.com/segmentio/go-loggly v0.5.0 h1:mnK6cIo6ajLsaaa1uqEi5IPsMlJYu+F0HpIoLjwIBFY= github.com/segmentio/go-loggly v0.5.0/go.mod h1:8zLRYR5npGjaOXgPSKat5+oOh+UHd8OdbS18iqX9F6Y= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= -github.com/solarwinds/papertrail-go v0.0.0-20210309063915-0dce0e9dca34 h1:KASG4nsonTSWXmUSqy2gpNZBXbPbjktogBiZr4JcWpY= -github.com/solarwinds/papertrail-go v0.0.0-20210309063915-0dce0e9dca34/go.mod h1:1+YX6B59vKCnkJezXZQ+/lUnwYbdv5oqe57xzt5UHXQ= +github.com/solarwinds/papertrail-go v0.0.0-20210601025410-ab261ef9e67e h1:C1eykkdmuiyDLibg63tHRzDBHyfAw8phrR/9gEyH3Co= +github.com/solarwinds/papertrail-go v0.0.0-20210601025410-ab261ef9e67e/go.mod h1:1+YX6B59vKCnkJezXZQ+/lUnwYbdv5oqe57xzt5UHXQ= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= diff --git a/vendor/github.com/solarwinds/papertrail-go/syslog.go b/vendor/github.com/solarwinds/papertrail-go/syslog.go index dae28178..49484d74 100644 --- a/vendor/github.com/solarwinds/papertrail-go/syslog.go +++ b/vendor/github.com/solarwinds/papertrail-go/syslog.go @@ -131,18 +131,28 @@ func (s *SrslogShipper) Write(packet *SyslogPacket) (err error) { ts = time.Now() } - timestamp := ts.Format(time.RFC3339) - // msg := fmt.Sprintf("<%d> %s %s %s %s - - - %s", packet.Severity, ts.Format(rfc5424time), packet.Hostname, s.tag, packet.Tag, packet.Message) - var msg string + // var msg string tag := packet.Tag if s.tag != "" { - tag = fmt.Sprintf("%s/%s", s.tag, tag) + tag = fmt.Sprintf("%s - %s", s.tag, tag) } - msg = fmt.Sprintf("<%d>%d %s %s %s - - - %s", - packet.Severity, 1, timestamp, packet.Hostname, tag, packet.Message) + timestamp := ts.Format(time.RFC3339) + // // r19 + // msg := fmt.Sprintf("<%d>%d %s %s %s - - - %s", + // packet.Severity, 1, timestamp, packet.Hostname, tag, packet.Message) + + // r17 + // msg = fmt.Sprintf("%s %s %s - %s", packet.Hostname, s.tag, packet.Tag, packet.Message) + + // works, get IP + // msg := fmt.Sprintf("%s %s - - - %s", packet.Hostname, tag, packet.Message) + + // msg := fmt.Sprintf("%s - %s - %s - %s", packet.Hostname, tag, timestamp, packet.Message) + + msg := fmt.Sprintf("%s - %s - %s - %s", packet.Hostname, tag, timestamp, packet.Message) _, err = s.writer.WriteWithPriority(packet.Severity, []byte(msg)) return err diff --git a/vendor/modules.txt b/vendor/modules.txt index fc8e0c89..d4ae8084 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -195,7 +195,7 @@ github.com/segmentio/go-loggly # github.com/sirupsen/logrus v1.8.1 ## explicit github.com/sirupsen/logrus -# github.com/solarwinds/papertrail-go v0.0.0-20210309063915-0dce0e9dca34 +# github.com/solarwinds/papertrail-go v0.0.0-20210601025410-ab261ef9e67e ## explicit github.com/solarwinds/papertrail-go # github.com/spf13/pflag v1.0.3