mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 20:36:12 +02:00
Fix event.timestamp pointer usage (#1621)
* Fix event.timestamp pointer usage * avoid returning an error when creating alerts if something goes wrong during the parsing Co-authored-by: Sebastien Blot <sebastien@crowdsec.net>
This commit is contained in:
parent
863facaa33
commit
02e0f3c095
2 changed files with 9 additions and 11 deletions
|
@ -188,7 +188,8 @@ func EventsFromQueue(queue *Queue) []*models.Event {
|
|||
}
|
||||
//either MarshaledTime is present and is extracted from log
|
||||
if evt.MarshaledTime != "" {
|
||||
ovflwEvent.Timestamp = &evt.MarshaledTime
|
||||
tmpTimeStamp := evt.MarshaledTime
|
||||
ovflwEvent.Timestamp = &tmpTimeStamp
|
||||
} else if !evt.Time.IsZero() { //or .Time has been set during parse as time.Now().UTC()
|
||||
ovflwEvent.Timestamp = new(string)
|
||||
raw, err := evt.Time.MarshalText()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue