#NEWLINE# def write( self , entry ) : #NEWLINE# #INDENT# if ( ( entry [ 'eventid' ] == 'cowrie.login.success' ) or ( entry [ 'eventid' ] == 'cowrie.login.failed' ) ) : #NEWLINE# #INDENT# date = dateutil . parser . parse ( entry [ 'timestamp' ] ) #NEWLINE# self . batch . append ( { #NEWLINE# #INDENT# 'date' : date . date ( ) . __str__ ( ) , #NEWLINE# 'time' : date . time ( ) . strftime ( '%H:%M:%S' ) , #NEWLINE# 'timezone' : time . strftime ( '%z' ) , #NEWLINE# 'source_ip' : entry [ 'src_ip' ] , #NEWLINE# 'user' : entry [ 'username' ] , #NEWLINE# 'password' : entry [ 'password' ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# if ( len ( self . batch ) >= self . batch_size ) : #NEWLINE# #INDENT# batch_to_send = self . batch #NEWLINE# self . submit_entries ( batch_to_send ) #NEWLINE# self . batch = [ ]