Have this code:
Ta***
HTTP"GET" "/api/fx/pr***/groups" responded 500'
if mail["Subject"].find("Alert for Ta*** prod errors") > 0 : body = get_autosys_body(mail) info = {} segments = body.split(' ') for line in body.splitlines(): if 'Application name' and 'null' in line: info['test'] = segments[0] + ' ' + segments[1] + ' ' + segments[2] + ' ' + segments[3] + ' ' + segments[4] elif 'Application name' in line: info['test'] = segments[0] + ' ' + segments[1] + ' ' + segments[2] + ' ' + segments[3] + ' ' + segments[4] + ' ' + segments[5] + segments[6] + ' ' + segments[7] + ' ' + segments[8] + ' ' + segments[9] print (info)which created info dictionary:
{'test': '\r\nApplication name: Ta***\r\nSource: eggs***\r\nTimestamp: 2019-***\r\nMessage:'} {'test': '\r\nApplication name: Ta***\r\nSource: ***\r\nTimestamp: 2019-***\r\nMessage: HTTP"GET" "/api/fx/pr***/groups" responded 500'}How to get Values after Application name, source and message (for second line example)
Ta***
HTTP"GET" "/api/fx/pr***/groups" responded 500'