Open rajcapg opened 6 years ago
{'26963': {'starttime': '07:18:01'}, '34695': {'starttime': '21:00:02'}, '11092': {'starttime': '17:18:02'}, '27912': {'starttime': '13:18:02'}, '18729': {'starttime': '11:18:02'}, '22461': {'starttime': '23:18:01'}, '11822': {'starttime': '01:18:01'}, '33879': {'starttime': '03:00:01'}, '3658': {'starttime': '09:18:01'}, '17829': {'starttime': '03:18:01'}, '16443': {'starttime': '21:00:02'}, '25423': {'starttime': '01:18:01'}, '30389': {'starttime': '07:00:01'}, '4614': {'starttime': '21:18:01'}, '40419': {'starttime': '03:18:01'}, '38038': {'starttime': '03:00:01'}, '24004': {'starttime': '03:00:02'}, '2058': {'starttime': '19:18:02'}, '7076': {'starttime': '19:18:02'}, '10791': {'starttime': '03:00:02'}, '4868': {'starttime': '21:00:02'}, '39423': {'starttime': '03:00:02'}, '39280': {'starttime': '09:18:01'}, '427': {'starttime': '05:18:01'}, '31330': {'starttime': '15:18:01'}, '9443': {'starttime': '07:00:02'}, '17550': {'starttime': '07:18:02'}, '9195': {'starttime': '05:18:02'}, '15352': {'starttime': '09:18:02'}, '29992': {'starttime': '05:18:01'}, '6406': {'starttime': '21:00:02'}, '34834': {'starttime': '23:18:01'}, '18028': {'starttime': '15:18:01'}, '34082': {'starttime': '21:18:01'}, '5366': {'starttime': '07:18:01'}, '17589': {'starttime': '17:18:01'}, '1978': {'starttime': '07:00:02'}, '6059': {'starttime': '13:18:02'}, '4698': {'starttime': '21:00:02'}, '17737': {'starttime': '07:00:02'}, '31735': {'starttime': '11:18:01'}} {'26963': {'endtime': '07:38:09'}, '34695': {'endtime': '21:21:35'}, '11092': {'endtime': '17:39:01'}, '27912': {'endtime': '13:38:48'}, '18729': {'endtime': '11:39:37'}, '22461': {'endtime': '23:37:44'}, '11822': {'endtime': '01:37:54'}, '33879': {'endtime': '03:22:17'}, '3658': {'endtime': '09:39:05'}, '17829': {'endtime': '03:38:00'}, '16443': {'endtime': '21:23:08'}, '25423': {'endtime': '01:37:44'}, '30389': {'endtime': '07:20:35'}, '4614': {'endtime': '21:38:25'}, '40419': {'endtime': '03:38:01'}, '38038': {'endtime': '03:22:40'}, '24004': {'endtime': '03:22:40'}, '2058': {'endtime': '19:38:06'}, '7076': {'endtime': '19:38:13'}, '10791': {'endtime': '03:21:53'}, '4868': {'endtime': '21:21:51'}, '39423': {'endtime': '03:22:49'}, '39280': {'endtime': '09:38:44'}, '427': {'endtime': '05:37:53'}, '31330': {'endtime': '15:38:39'}, '9443': {'endtime': '07:20:55'}, '17550': {'endtime': '07:38:10'}, '9195': {'endtime': '05:38:43'}, '15352': {'endtime': '09:38:31'}, '29992': {'endtime': '05:37:48'}, '6406': {'endtime': '21:22:47'}, '34834': {'endtime': '23:38:50'}, '18028': {'endtime': '15:38:47'}, '34082': {'endtime': '21:38:14'}, '5366': {'endtime': '07:38:35'}, '17589': {'endtime': '17:38:37'}, '1978': {'endtime': '07:20:20'}, '6059': {'endtime': '13:38:49'}, '4698': {'endtime': '21:21:51'}, '17737': {'endtime': '07:21:20'}, '31735': {'endtime': '11:38:59'}} {'26963': {'updateClusterId': ' 590021143592'}, '34695': {'updateClusterId': ' 590021143592'}, '11092': {'updateClusterId': ' 590021143592'}, '27912': {'updateClusterId': ' 590021143592'}, '18729': {'updateClusterId': ' 590021143592'}, '22461': {'updateClusterId': ' 590021143592'}, '11822': {'updateClusterId': ' 590021143592'}, '33879': {'updateClusterId': ' 590021143592'}, '3658': {'updateClusterId': ' 590021143592'}, '17829': {'updateClusterId': ' 590021143592'}, '16443': {'updateClusterId': ' 590021143592'}, '25423': {'updateClusterId': ' 590021143592'}, '30389': {'updateClusterId': ' 590021143592'}, '4614': {'updateClusterId': ' 590021143592'}, '40419': {'updateClusterId': ' 590021143592'}, '38038': {'updateClusterId': ' 590021143592'}, '24004': {'updateClusterId': ' 590021143592'}, '2058': {'updateClusterId': ' 590021143592'}, '7076': {'updateClusterId': ' 590021143592'}, '10791': {'updateClusterId': ' 590021143592'}, '4868': {'updateClusterId': ' 590021143592'}, '39423': {'updateClusterId': ' 590021143592'}, '39280': {'updateClusterId': ' 590021143592'}, '427': {'updateClusterId': ' 590021143592'}, '31330': {'updateClusterId': ' 590021143592'}, '9443': {'updateClusterId': ' 590021143592'}, '17550': {'updateClusterId': ' 590021143592'}, '9195': {'updateClusterId': ' 590021143592'}, '15352': {'updateClusterId': ' 590021143592'}, '29992': {'updateClusterId': ' 590021143592'}, '6406': {'updateClusterId': ' 590021143592'}, '34834': {'updateClusterId': ' 590021143592'}, '18028': {'updateClusterId': ' 590021143592'}, '34082': {'updateClusterId': ' 590021143592'}, '5366': {'updateClusterId': ' 590021143592'}, '17589': {'updateClusterId': ' 590021143592'}, '1978': {'updateClusterId': ' 590021143592'}, '6059': {'updateClusterId': ' 590021143592'}, '4698': {'updateClusterId': ' 590021143592'}, '17737': {'updateClusterId': ' 590021143592'}, '31735': {'updateClusterId': ' 590021143592'}}
import re
EPS always looks salesforce/other database .Scripts extracts data from thalia_push-to-salesforce.log in below pattern
process_id|start_time|end|time|No of clusterID Update|No of Cluster ID which only update latest heartbeat i.e no as much imp data for EPS .
EPS{process_id}{'starttime'}=start_time
EPS{process_id}{'EndTime'}=Endtime
EPS{process_id}{'Update'}=clusterId
EPS{process_id}{'OnlyHeartbeatupdate'}
regex = re.compile(r'Init')
with open('thalia_push-to-salesforce.log') as f: data = [] for line in f: data.append(line)
dict1={} dict2={} dict3={}
for line in data: matchObj = re.search( r'(.+)INIT|Init', line, re.M|re.I) if matchObj: remaingpattern =matchObj.group(1) a=remaingpattern.split("|") starttime=a[1] processId1=a[5] dict1[processId1]={} dict1[processId1]['starttime']=starttime matchDone = re.search(r'(.+)Done',line ,re.M) if matchDone: remaingpattern = matchDone.group(1) b=remaingpattern.split("|") endtime=b[1] processId=b[5] dict2[processId]={} dict2[processId]['endtime']=endtime
print(dict1)
print (dict2) print (dict3)