def mongodb(line):
keys = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT:message>']<EOL>values = re.split(r'<STR_LIT>', line, maxsplit=<NUM_LIT:4>)<EOL>mongodb_log = dict(zip(keys,values))<EOL>return dict(<EOL>timestamp=values[<NUM_LIT:0>],<EOL>data=mongodb_log,<EOL>type='<STR_LIT>',<EOL>)<EOL>
>>> import pprint
>>> input_line1 = '2017-08-17T07:56:33.489+0200 I REPL     [signalProcessingThread] shutting down replication subsystems'
>>> output_line1 = mongodb(input_line1)
>>> pprint.pprint(output_line1)
{'data': {'component': 'REPL',
          'context': '[signalProcessingThread]',
          'message': 'shutting down replication subsystems',
          'severity': 'I',
          'timestamp': '2017-08-17T07:56:33.489+0200'},
 'timestamp': '2017-08-17T07:56:33.489+0200',
 'type': 'log'}

>>> input_line2 = '2017-08-17T07:56:33.515+0200 W NETWORK  [initandlisten] No primary detected for set confsvr_repl1'
>>> output_line2 = mongodb(input_line2)
>>> pprint.pprint(output_line2)
{'data': {'component': 'NETWORK',
          'context': '[initandlisten]',
          'message': 'No primary detected for set confsvr_repl1',
          'severity': 'W',
          'timestamp': '2017-08-17T07:56:33.515+0200'},
 'timestamp': '2017-08-17T07:56:33.515+0200',
 'type': 'log'}