You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pkg/api/transform_network.go
+64-8Lines changed: 64 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,12 @@ type TransformNetwork struct {
26
26
DirectionInfoNetworkTransformDirectionInfo`yaml:"directionInfo,omitempty" json:"directionInfo,omitempty" doc:"information to reinterpret flow direction (optional, to use with reinterpret_direction rule)"`
@@ -73,6 +79,12 @@ type NetworkTransformRule struct {
73
79
DecodeTCPFlags*NetworkGenericRule`yaml:"decode_tcp_flags,omitempty" json:"decode_tcp_flags,omitempty" doc:"Decode bitwise TCP flags into a string"`
74
80
}
75
81
82
+
func (r*NetworkTransformRule) preprocess() {
83
+
ifr.Kubernetes!=nil {
84
+
r.Kubernetes.preprocess()
85
+
}
86
+
}
87
+
76
88
typeK8sInfraRulestruct {
77
89
NamespaceNameFields []K8sReference`yaml:"namespaceNameFields,omitempty" json:"namespaceNameFields,omitempty" doc:"entries for namespace and name input fields"`
Assigneestring`yaml:"assignee,omitempty" json:"assignee,omitempty" doc:"value needs to assign to output field"`
95
-
LabelsPrefixstring`yaml:"labels_prefix,omitempty" json:"labels_prefix,omitempty" doc:"labels prefix to use to copy input lables, if empty labels will not be copied"`
96
-
AddZonebool`yaml:"add_zone,omitempty" json:"add_zone,omitempty" doc:"if true the rule will add the zone"`
101
+
IPFieldstring`yaml:"ipField,omitempty" json:"ipField,omitempty" doc:"entry IP input field"`
Assigneestring`yaml:"assignee,omitempty" json:"assignee,omitempty" doc:"value needs to assign to output field"`
107
+
LabelsPrefixstring`yaml:"labels_prefix,omitempty" json:"labels_prefix,omitempty" doc:"labels prefix to use to copy input lables, if empty labels will not be copied"`
108
+
AddZonebool`yaml:"add_zone,omitempty" json:"add_zone,omitempty" doc:"if true the rule will add the zone"`
109
+
OutputKeysK8SOutputKeys`yaml:"-" json:"-"`
110
+
}
111
+
112
+
typeK8SOutputKeysstruct {
113
+
Namespacestring
114
+
Namestring
115
+
Kindstring
116
+
OwnerNamestring
117
+
OwnerKindstring
118
+
NetworkNamestring
119
+
HostIPstring
120
+
HostNamestring
121
+
Zonestring
122
+
}
123
+
124
+
func (r*K8sRule) preprocess() {
125
+
ifr.Assignee=="otel" {
126
+
// NOTE: Some of these fields are taken from opentelemetry specs.
127
+
// See https://opentelemetry.io/docs/specs/semconv/resource/k8s/
128
+
// Other fields (not specified in the specs) are named similarly
0 commit comments