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

Bug: Set netflow event.created to use current timestamp #23094

Merged
merged 2 commits into from
Jan 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Fix integer overflow in S3 offsets when collecting very large files. {pull}22523[22523]
- Fix various processing errors in the Suricata module. {pull}23236[23236]
- Fix CredentialsJSON unpacking for `gcp-pubsub` and `httpjson` inputs. {pull}23277[23277]
- Change the `event.created` in Netflow events to be the time the event was created by Filebeat
to be consistent with ECS. {pull}23094[23094]

*Filebeat*

Expand Down
2 changes: 1 addition & 1 deletion x-pack/filebeat/input/netflow/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func toBeatEventCommon(flow record.Record) (event beat.Event) {

// ECS Fields -- event
ecsEvent := common.MapStr{
"created": flow.Timestamp,
"created": time.Now().UTC(),
"kind": "event",
"category": []string{"network_traffic", "network"},
"action": flow.Fields["type"],
Expand Down
8 changes: 6 additions & 2 deletions x-pack/filebeat/input/netflow/netflow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,9 @@ func getFlowsFromDat(t testing.TB, name string, testCase TestCase) TestResult {
}
ev := make([]beat.Event, len(flows))
for i := range flows {
ev[i] = toBeatEvent(flows[i], []string{"private"})
flow := toBeatEvent(flows[i], []string{"private"})
flow.Fields.Delete("event.created")
ev[i] = flow
}
//return TestResult{Name: name, Error: err.Error(), Events: flowsToEvents(flows)}
events = append(events, ev...)
Expand Down Expand Up @@ -242,7 +244,9 @@ func getFlowsFromPCAP(t testing.TB, name, pcapFile string) TestResult {
}
ev := make([]beat.Event, len(flows))
for i := range flows {
ev[i] = toBeatEvent(flows[i], []string{"private"})
flow := toBeatEvent(flows[i], []string{"private"})
flow.Fields.Delete("event.created")
ev[i] = flow
}
events = append(events, ev...)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"network_traffic",
"network"
],
"created": "2018-04-18T08:16:47Z",
"duration": 0,
"kind": "event",
"type": [
Expand Down Expand Up @@ -109,7 +108,6 @@
"network_traffic",
"network"
],
"created": "2018-04-18T08:16:47Z",
"duration": 0,
"kind": "event",
"type": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"network_traffic",
"network"
],
"created": "2017-06-29T13:58:28Z",
"duration": 20269000000,
"kind": "event",
"type": [
Expand Down Expand Up @@ -97,7 +96,6 @@
"network_traffic",
"network"
],
"created": "2017-06-29T13:58:28Z",
"duration": 20269000000,
"kind": "event",
"type": [
Expand Down Expand Up @@ -178,7 +176,6 @@
"network_traffic",
"network"
],
"created": "2017-06-29T13:58:28Z",
"duration": 20306000000,
"kind": "event",
"type": [
Expand Down Expand Up @@ -259,7 +256,6 @@
"network_traffic",
"network"
],
"created": "2017-06-29T13:58:28Z",
"duration": 20306000000,
"kind": "event",
"type": [
Expand Down Expand Up @@ -340,7 +336,6 @@
"network_traffic",
"network"
],
"created": "2017-06-29T13:58:28Z",
"duration": 20317000000,
"kind": "event",
"type": [
Expand Down Expand Up @@ -421,7 +416,6 @@
"network_traffic",
"network"
],
"created": "2017-06-29T13:58:28Z",
"duration": 20317000000,
"kind": "event",
"type": [
Expand Down Expand Up @@ -502,7 +496,6 @@
"network_traffic",
"network"
],
"created": "2017-06-29T13:58:28Z",
"duration": 20368000000,
"kind": "event",
"type": [
Expand Down Expand Up @@ -583,7 +576,6 @@
"network_traffic",
"network"
],
"created": "2017-06-29T13:58:28Z",
"duration": 20368000000,
"kind": "event",
"type": [
Expand Down
Loading