MCPcopy Index your code
hub / github.com/crowdsecurity/crowdsec / msgToEvent

Method msgToEvent

pkg/acquisition/modules/syslog/run.go:81–98  ·  view source on GitHub ↗
(msg syslogserver.SyslogMessage)

Source from the content-addressed store, hash-verified

79}
80
81func (s *Source) msgToEvent(msg syslogserver.SyslogMessage) (*pipeline.Event, error) {
82 line, err := s.parseLine(msg)
83 if err != nil {
84 return nil, err
85 }
86
87 evt := pipeline.MakeEvent(s.config.UseTimeMachine, pipeline.LOG, true)
88 evt.Line = pipeline.Line{
89 Raw: line,
90 Src: msg.Client,
91 Time: time.Time{},
92 Labels: s.config.Labels,
93 Module: s.GetName(),
94 Process: true,
95 }
96
97 return &evt, nil
98}
99
100func (s *Source) buildLogFromSyslog(ts time.Time, hostname string,
101 appname string, pid string, msg string,

Callers 1

StreamMethod · 0.95

Calls 3

parseLineMethod · 0.95
GetNameMethod · 0.95
MakeEventFunction · 0.92

Tested by

no test coverage detected