Skip to content

Commit

Permalink
#871 Fix MISP synchro log message
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Feb 12, 2019
1 parent 2279f6a commit cd436ea
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions thehive-misp/app/connectors/misp/MispSynchro.scala
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,10 @@ class MispSynchro @Inject() (
}

def synchronize(mispConnection: MispConnection, lastSyncDate: Option[Date])(implicit authContext: AuthContext): Source[Try[Alert], NotUsed] = {
logger.info(s"Synchronize MISP ${mispConnection.name} from $lastSyncDate")
val syncFrom = mispConnection.syncFrom(lastSyncDate.getOrElse(new Date(0)))
logger.info(s"Last synchronization of MISP ${mispConnection.name} is ${lastSyncDate.fold("Never")(_.toString)}, synchronize from $syncFrom")
// get events that have been published after the last synchronization
mispSrv.getEventsFromDate(mispConnection, mispConnection.syncFrom(lastSyncDate.getOrElse(new Date(0))))
mispSrv.getEventsFromDate(mispConnection, syncFrom)
// get related alert
.mapAsyncUnordered(1) { event
logger.trace(s"Looking for alert misp:${event.source}:${event.sourceRef}")
Expand Down

0 comments on commit cd436ea

Please sign in to comment.