Skip to content

Commit

Permalink
defaulting to ingress for flow direction unless we say otherwise (#648)
Browse files Browse the repository at this point in the history
  • Loading branch information
i3149 authored Jan 4, 2024
1 parent d29731c commit 2789153
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/inputs/flow/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,11 @@ func (t *KentikDriver) toJCHF(fmsg *pp.ProtoProducerMessage) *kt.JCHF {
}
}

// Default in direction if its not already set. Assume its ingress unless otherwise told.
if _, ok := in.CustomStr["FlowDirection"]; !ok {
in.CustomStr["FlowDirection"] = "ingress"
}

// Now add some combo fields.
in.CustomStr["src_endpoint"] = in.SrcAddr + ":" + strconv.Itoa(int(in.L4SrcPort))
in.CustomStr["dst_endpoint"] = in.DstAddr + ":" + strconv.Itoa(int(in.L4DstPort))
Expand Down

0 comments on commit 2789153

Please sign in to comment.