Skip to content

Commit

Permalink
add new field to ipfix exporter for flowRtt
Browse files Browse the repository at this point in the history
  • Loading branch information
bhale-ibm committed Feb 20, 2024
1 parent a56fc72 commit 4b4d3f9
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion pkg/pipeline/write/write_ipfix.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ func addKubeContextToTemplate(elements *[]entities.InfoElementWithValue, registr
if err != nil {
return err
}
err = addElementToTemplate("timeFlowRttNs", nil, elements, registryID)
if err != nil {
return err
}
return nil
}

Expand Down Expand Up @@ -124,6 +128,11 @@ func loadCustomRegistry(EnterpriseID uint32) error {
ilog.WithError(err).Errorf("Failed to register element")
return err
}
err = registry.PutInfoElement((*entities.NewInfoElement("timeFlowRttNs", 7740, 13, EnterpriseID, 65535)), EnterpriseID)
if err != nil {
ilog.WithError(err).Errorf("Failed to register element")
return err
}
return nil
}

Expand Down Expand Up @@ -445,7 +454,13 @@ func setKubeIEValue(record config.GenericMap, ieValPtr *entities.InfoElementWith
} else {
ieVal.SetStringValue("none")
}
}
case "timeFlowRttNs":
if record["TimeFlowRttNs"] != nil {
ieVal.SetUnsigned64Value(record["TimeFlowRttNs"].(uint64))
} else {
// nothing here for now
}
}
}
func setEntities(record config.GenericMap, enrichEnterpriseID uint32, elements *[]entities.InfoElementWithValue) error {
for _, ieVal := range *elements {
Expand Down

0 comments on commit 4b4d3f9

Please sign in to comment.