Skip to content

Commit 13e630b

Browse files
authored
NetFlow/IPFIX: render sampler address as string (#950)
Fixes #940
1 parent 2e03296 commit 13e630b

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

pkg/pipeline/ingest/ingest_collector.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ func RenderMessage(message *goflowpb.FlowMessage) (map[string]interface{}, error
7070
}
7171
outputMap["DstAddr"] = goflowCommonFormat.RenderIP(message.DstAddr)
7272
outputMap["SrcAddr"] = goflowCommonFormat.RenderIP(message.SrcAddr)
73+
outputMap["SamplerAddress"] = goflowCommonFormat.RenderIP(message.SamplerAddress)
7374
outputMap["DstMac"] = renderMac(message.DstMac)
7475
outputMap["SrcMac"] = renderMac(message.SrcMac)
7576
return outputMap, nil

pkg/pipeline/ingest/ingest_collector_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ func TestIngest(t *testing.T) {
5353
assert.EqualValues(t, 12345678, flow["TimeFlowStart"])
5454
assert.EqualValues(t, 12345678, flow["TimeFlowEnd"])
5555
assert.Equal(t, "1.2.3.4", flow["SrcAddr"])
56+
assert.Equal(t, "127.0.0.1", flow["SamplerAddress"])
5657
}
5758

5859
// The IPFIX client might send information before the Ingester is actually listening,

0 commit comments

Comments
 (0)