@@ -160,7 +160,8 @@ func (n *Node) ProcessStatics(statics []ExtraField, event *types.Event) error {
160
160
}
161
161
}
162
162
163
- if static .Method != "" {
163
+ switch {
164
+ case static .Method != "" :
164
165
processed := false
165
166
/*still way too hackish, but : inject all the results in enriched, and */
166
167
if enricherPlugin , ok := n .EnrichFunctions .Registered [static .Method ]; ok {
@@ -186,22 +187,22 @@ func (n *Node) ProcessStatics(statics []ExtraField, event *types.Event) error {
186
187
if ! processed {
187
188
clog .Debugf ("method '%s' doesn't exist" , static .Method )
188
189
}
189
- } else if static .Parsed != "" {
190
+ case static .Parsed != "" :
190
191
clog .Debugf (".Parsed[%s] = '%s'" , static .Parsed , value )
191
192
event .Parsed [static .Parsed ] = value
192
- } else if static .Meta != "" {
193
+ case static .Meta != "" :
193
194
clog .Debugf (".Meta[%s] = '%s'" , static .Meta , value )
194
195
event .Meta [static .Meta ] = value
195
- } else if static .Enriched != "" {
196
+ case static .Enriched != "" :
196
197
clog .Debugf (".Enriched[%s] = '%s'" , static .Enriched , value )
197
198
event .Enriched [static .Enriched ] = value
198
- } else if static .TargetByName != "" {
199
+ case static .TargetByName != "" :
199
200
if ! SetTargetByName (static .TargetByName , value , event ) {
200
201
clog .Errorf ("Unable to set value of '%s'" , static .TargetByName )
201
202
} else {
202
203
clog .Debugf ("%s = '%s'" , static .TargetByName , value )
203
204
}
204
- } else {
205
+ default :
205
206
clog .Fatal ("unable to process static : unknown target" )
206
207
}
207
208
}
0 commit comments