-
Notifications
You must be signed in to change notification settings - Fork 627
/
Copy pathcommunityidprocessor.go
187 lines (127 loc) · 4.88 KB
/
communityidprocessor.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
// Code generated from the elasticsearch-specification DO NOT EDIT.
// https://github.com/elastic/elasticsearch-specification/tree/ea991724f4dd4f90c496eff547d3cc2e6529f509
package esdsl
import "github.com/elastic/go-elasticsearch/v8/typedapi/types"
type _communityIDProcessor struct {
v *types.CommunityIDProcessor
}
// Computes the Community ID for network flow data as defined in the
// Community ID Specification. You can use a community ID to correlate network
// events related to a single flow.
func NewCommunityIDProcessor() *_communityIDProcessor {
return &_communityIDProcessor{v: types.NewCommunityIDProcessor()}
}
// Description of the processor.
// Useful for describing the purpose of the processor or its configuration.
func (s *_communityIDProcessor) Description(description string) *_communityIDProcessor {
s.v.Description = &description
return s
}
// Field containing the destination IP address.
func (s *_communityIDProcessor) DestinationIp(field string) *_communityIDProcessor {
s.v.DestinationIp = &field
return s
}
// Field containing the destination port.
func (s *_communityIDProcessor) DestinationPort(field string) *_communityIDProcessor {
s.v.DestinationPort = &field
return s
}
// Field containing the IANA number.
func (s *_communityIDProcessor) IanaNumber(field string) *_communityIDProcessor {
s.v.IanaNumber = &field
return s
}
// Field containing the ICMP code.
func (s *_communityIDProcessor) IcmpCode(field string) *_communityIDProcessor {
s.v.IcmpCode = &field
return s
}
// Field containing the ICMP type.
func (s *_communityIDProcessor) IcmpType(field string) *_communityIDProcessor {
s.v.IcmpType = &field
return s
}
// Conditionally execute the processor.
func (s *_communityIDProcessor) If(if_ types.ScriptVariant) *_communityIDProcessor {
s.v.If = if_.ScriptCaster()
return s
}
// Ignore failures for the processor.
func (s *_communityIDProcessor) IgnoreFailure(ignorefailure bool) *_communityIDProcessor {
s.v.IgnoreFailure = &ignorefailure
return s
}
// If true and any required fields are missing, the processor quietly exits
// without modifying the document.
func (s *_communityIDProcessor) IgnoreMissing(ignoremissing bool) *_communityIDProcessor {
s.v.IgnoreMissing = &ignoremissing
return s
}
// Handle failures for the processor.
func (s *_communityIDProcessor) OnFailure(onfailures ...types.ProcessorContainerVariant) *_communityIDProcessor {
for _, v := range onfailures {
s.v.OnFailure = append(s.v.OnFailure, *v.ProcessorContainerCaster())
}
return s
}
// Seed for the community ID hash. Must be between 0 and 65535 (inclusive). The
// seed can prevent hash collisions between network domains, such as a staging
// and production network that use the same addressing scheme.
func (s *_communityIDProcessor) Seed(seed int) *_communityIDProcessor {
s.v.Seed = &seed
return s
}
// Field containing the source IP address.
func (s *_communityIDProcessor) SourceIp(field string) *_communityIDProcessor {
s.v.SourceIp = &field
return s
}
// Field containing the source port.
func (s *_communityIDProcessor) SourcePort(field string) *_communityIDProcessor {
s.v.SourcePort = &field
return s
}
// Identifier for the processor.
// Useful for debugging and metrics.
func (s *_communityIDProcessor) Tag(tag string) *_communityIDProcessor {
s.v.Tag = &tag
return s
}
// Output field for the community ID.
func (s *_communityIDProcessor) TargetField(field string) *_communityIDProcessor {
s.v.TargetField = &field
return s
}
// Field containing the transport protocol name or number. Used only when the
// iana_number field is not present. The following protocol names are currently
// supported: eigrp, gre, icmp, icmpv6, igmp, ipv6-icmp, ospf, pim, sctp, tcp,
// udp
func (s *_communityIDProcessor) Transport(field string) *_communityIDProcessor {
s.v.Transport = &field
return s
}
func (s *_communityIDProcessor) ProcessorContainerCaster() *types.ProcessorContainer {
container := types.NewProcessorContainer()
container.CommunityId = s.v
return container
}
func (s *_communityIDProcessor) CommunityIDProcessorCaster() *types.CommunityIDProcessor {
return s.v
}