There's no need for an actual deep copy The event is almost empty, we are mostly interested in allocating new maps for Parsed/Meta/...
(evt pipeline.Event, line string)
| 445 | // There's no need for an actual deep copy |
| 446 | // The event is almost empty, we are mostly interested in allocating new maps for Parsed/Meta/... |
| 447 | func copyEvent(evt pipeline.Event, line string) pipeline.Event { |
| 448 | evtCopy := pipeline.MakeEvent(evt.ExpectMode == pipeline.TIMEMACHINE, evt.Type, evt.Process) |
| 449 | evtCopy.Line = evt.Line |
| 450 | evtCopy.Line.Raw = line |
| 451 | evtCopy.Line.Labels = make(map[string]string) |
| 452 | |
| 453 | maps.Copy(evtCopy.Line.Labels, evt.Line.Labels) |
| 454 | |
| 455 | return evtCopy |
| 456 | } |
| 457 | |
| 458 | func transform( |
| 459 | transformChan chan pipeline.Event, |