def haproxy(line):<EOL>
_line = line.strip().split()<EOL>log = {}<EOL>log['<STR_LIT>'] = _line[<NUM_LIT:5>].split('<STR_LIT::>')[<NUM_LIT:0>].strip()<EOL>log['<STR_LIT>'] = _line[<NUM_LIT:5>].split('<STR_LIT::>')[<NUM_LIT:1>].strip()<EOL>_timestamp = re.findall(r'<STR_LIT>', _line[<NUM_LIT:6>])[<NUM_LIT:0>]<EOL>log['<STR_LIT>'] = datetime.datetime.strptime(_timestamp, '<STR_LIT>').isoformat()<EOL>log['<STR_LIT>'] = _line[<NUM_LIT:7>].strip()<EOL>log['<STR_LIT>'] = _line[<NUM_LIT:8>].strip()<EOL>log['<STR_LIT>'] = float(_line[<NUM_LIT:9>].split('<STR_LIT:/>')[<NUM_LIT:0>].strip())<EOL>log['<STR_LIT>'] = float(_line[<NUM_LIT:9>].split('<STR_LIT:/>')[<NUM_LIT:1>].strip())<EOL>log['<STR_LIT>'] = float(_line[<NUM_LIT:9>].split('<STR_LIT:/>')[<NUM_LIT:2>].strip())<EOL>log['<STR_LIT>'] = float(_line[<NUM_LIT:9>].split('<STR_LIT:/>')[<NUM_LIT:3>].strip())<EOL>log['<STR_LIT>'] = float(_line[<NUM_LIT:9>].split('<STR_LIT:/>')[-<NUM_LIT:1>].strip())<EOL>log['<STR_LIT:status>'] = _line[<NUM_LIT:10>].strip()<EOL>log['<STR_LIT>'] = float(_line[<NUM_LIT:11>].strip())<EOL>log['<STR_LIT>'] = re.findall(r'<STR_LIT>', line)<EOL>log['<STR_LIT>'] = _line[<NUM_LIT:3>].strip()<EOL>log['<STR_LIT>'] = _line[-<NUM_LIT:3>].strip('<STR_LIT:">').strip()<EOL>log['<STR_LIT>'] = _line[-<NUM_LIT:2>].strip()<EOL>log['<STR_LIT>'] = int(_line[<NUM_LIT:15>].split('<STR_LIT:/>')[-<NUM_LIT:1>].strip())<EOL>log['<STR_LIT>'] = int(_line[<NUM_LIT:15>].split('<STR_LIT:/>')[<NUM_LIT:0>].strip())<EOL>log['<STR_LIT>'] = int(_line[<NUM_LIT:15>].split('<STR_LIT:/>')[<NUM_LIT:1>].strip())<EOL>log['<STR_LIT>'] = int(_line[<NUM_LIT:15>].split('<STR_LIT:/>')[-<NUM_LIT:2>].strip())<EOL>log['<STR_LIT>'] = int(_line[<NUM_LIT:15>].split('<STR_LIT:/>')[-<NUM_LIT:3>].strip())<EOL>log['<STR_LIT>'] = int(_line[<NUM_LIT:16>].split('<STR_LIT:/>')[<NUM_LIT:0>].strip())<EOL>log['<STR_LIT>'] = int(_line[<NUM_LIT:16>].split('<STR_LIT:/>')[<NUM_LIT:1>].strip())<EOL>return dict(<EOL>data=log,<EOL>event='<STR_LIT>',<EOL>timestamp=log.get('<STR_LIT>'),<EOL>type='<STR_LIT>'<EOL>)<EOL>
>>> import pprint
>>> input_line1 = 'Apr 24 00:00:02 node haproxy[12298]: 1.1.1.1:48660 [24/Apr/2019:00:00:02.358] pre-staging~ pre-staging_doc/pre-staging_active 261/0/2/8/271 200 2406 - - ---- 4/4/0/1/0 0/0 {AAAAAA:AAAAA_AAAAA:AAAAA_AAAAA_AAAAA:300A||| user@mail.net:sdasdasdasdsdasAHDivsjd=|user@mail.net|2018} "GET /doc/api/get?call=apple HTTP/1.1"'
>>> output_line1 = haproxy(input_line1)
>>> pprint.pprint(output_line1)
{'data': {'Tc': 2.0,
          'Tq': 261.0,
          'Tr': 8.0,
          'Tw': 0.0,
          '_api': '/doc/api/get?call=apple',
          '_headers': ['AAAAAA:AAAAA_AAAAA:AAAAA_AAAAA_AAAAA:300A||| user@mail.net:sdasdasdasdsdasAHDivsjd=|user@mail.net|2018'],
          'actconn': 4,
          'backend': 'pre-staging_doc/pre-staging_active',
          'backend_queue': 0,
          'beconn': 1,
          'bytes_read': 2406.0,
          'client_port': '48660',
          'client_server': '1.1.1.1',
          'feconn': 4,
          'front_end': 'pre-staging~',
          'haproxy_server': 'node',
          'method': 'GET',
          'resp_time': 271.0,
          'retries': 0,
          'srv_conn': 0,
          'srv_queue': 0,
          'status': '200',
          'timestamp': '2019-04-24T00:00:02.358000'},
 'event': 'haproxy_event',
 'timestamp': '2019-04-24T00:00:02.358000',
 'type': 'metric'}