fix(inputs.netflow): Fix sFlow metric timestamp (#14195)

This commit is contained in:
Thomas Casteleyn 2023-10-30 12:18:55 +01:00 committed by GitHub
parent 27b20d17ae
commit 12d8c3d0f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -34,6 +34,7 @@ func (d *sflowv5Decoder) Init() error {
}
func (d *sflowv5Decoder) Decode(srcIP net.IP, payload []byte) ([]telegraf.Metric, error) {
t := time.Now()
src := srcIP.String()
// Decode the message
@ -49,7 +50,6 @@ func (d *sflowv5Decoder) Decode(srcIP net.IP, payload []byte) ([]telegraf.Metric
return nil, fmt.Errorf("unexpected message type %T", packet)
}
t := time.Unix(0, int64(msg.Uptime)*int64(time.Millisecond))
metrics := make([]telegraf.Metric, 0, len(msg.Samples))
for _, s := range msg.Samples {
tags := map[string]string{