-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cherry-pick #10945 to 7.0: [Filebeat] NetFlow input support for custom field definitions #11223
Conversation
…c#10945) This PR adds support for loading custom (enterprise-specific) fields to the Filebeat NetFlow input. These fields can extend and/or override fields in NetFlow V9 and IPFIX. For compatibility, the feature uses the same field definition YAML format as Logstash's netflow codec plugin. A new configuration option custom_definitions consists of a list of paths to definition files. (cherry picked from commit cd49078)
@@ -92,7 +94,15 @@ func (d DecoderV9) ReadFieldDefinition(buf *bytes.Buffer) (field fields.Key, len | |||
return field, length, nil | |||
} | |||
|
|||
func (d DecoderV9) GetFields() fields.FieldDict { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported method DecoderV9.GetFields should have comment or be unexported
@@ -20,12 +20,20 @@ type Field struct { | |||
|
|||
type FieldDict map[Key]*Field | |||
|
|||
func RegisterFields(dict FieldDict) error { | |||
func RegisterGlobalFields(dict FieldDict) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported function RegisterGlobalFields should have comment or be unexported
@@ -6,7 +6,7 @@ package fields | |||
|
|||
import "fmt" | |||
|
|||
var Fields = FieldDict{} | |||
var GlobalFields = FieldDict{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported var GlobalFields should have comment or be unexported
@@ -92,7 +94,15 @@ func (d DecoderV9) ReadFieldDefinition(buf *bytes.Buffer) (field fields.Key, len | |||
return field, length, nil | |||
} | |||
|
|||
func (d DecoderV9) GetFields() fields.FieldDict { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported method DecoderV9.GetFields should have comment or be unexported
@@ -20,12 +20,20 @@ type Field struct { | |||
|
|||
type FieldDict map[Key]*Field | |||
|
|||
func RegisterFields(dict FieldDict) error { | |||
func RegisterGlobalFields(dict FieldDict) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported function RegisterGlobalFields should have comment or be unexported
@@ -6,7 +6,7 @@ package fields | |||
|
|||
import "fmt" | |||
|
|||
var Fields = FieldDict{} | |||
var GlobalFields = FieldDict{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exported var GlobalFields should have comment or be unexported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be a changelog for this or is there already something in there for netflow custom fields?
@andrewkroh I will add an entry |
4ce131a
to
158bdec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Cherry-pick of PR #10945 to 7.0 branch. Original message:
This PR adds support for loading custom (enterprise-specific) fields to the Filebeat NetFlow input.
These fields can extend and/or override fields in NetFlow V9 and IPFIX.
For compatibility, the feature uses the same field definition YAML format as Logstash's netflow codec plugin.
A new configuration option
custom_definitions
consists of a list of paths to definition files.