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

[Heartbeat] Dedupe screenshots / Extra Args #25808

Merged
merged 22 commits into from
Jun 8, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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
7 changes: 7 additions & 0 deletions x-pack/heartbeat/monitors/browser/synthexec/enrich.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"fmt"
"time"

"github.com/elastic/beats/v7/libbeat/beat/events"
"github.com/elastic/beats/v7/libbeat/processors/add_data_stream_index"

"github.com/gofrs/uuid"
Expand Down Expand Up @@ -113,6 +114,12 @@ func (je *journeyEnricher) enrichSynthEvent(event *beat.Event, se *SynthEvent) e
add_data_stream_index.SetEventDataset(event, "browser_network")
}

if se.Id != "" {
event.SetID(se.Id)
// This is only relevant for screenshots, which have a specific ID
// In that case we always want to issue an update op
event.Meta.Put(events.FieldMetaOpType, events.OpTypeCreate)
}
eventext.MergeEventFields(event, se.ToMap())

if je.urlFields == nil {
Expand Down
1 change: 1 addition & 0 deletions x-pack/heartbeat/monitors/browser/synthexec/synthtypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
)

type SynthEvent struct {
Id string `json:"_id"`
Type string `json:"type"`
PackageVersion string `json:"package_version"`
Step *Step `json:"step"`
Expand Down