Skip to content
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

Merged
merged 2 commits into from
Mar 13, 2019

Conversation

adriansr
Copy link
Contributor

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.

…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 {

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 {

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{}

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 {

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 {

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{}

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

Copy link
Member

@andrewkroh andrewkroh left a 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?

@adriansr
Copy link
Contributor Author

@andrewkroh I will add an entry

@adriansr adriansr force-pushed the backport_10945_7.0 branch from 4ce131a to 158bdec Compare March 13, 2019 18:01
Copy link
Member

@andrewkroh andrewkroh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@adriansr adriansr merged commit 8e6bd62 into elastic:7.0 Mar 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants