From 193c10eaebb4baf37db37898075de11d9b46c3a0 Mon Sep 17 00:00:00 2001 From: Jyoti Shekhar Date: Wed, 9 Aug 2023 23:21:48 -0700 Subject: [PATCH] Fixed to handle Union of datasources and date as column 1 --- src/python/processors/BrokerLogParser.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/python/processors/BrokerLogParser.py b/src/python/processors/BrokerLogParser.py index ee257b8..dc95c7e 100755 --- a/src/python/processors/BrokerLogParser.py +++ b/src/python/processors/BrokerLogParser.py @@ -31,20 +31,31 @@ def main(): except: continue try: - logTime = inLine[0].split()[5] + logTime = inLine[0].split()[0] logDate = datetime.datetime.strptime(logTime, "%Y-%m-%dT%H:%M:%S.%fZ") except: continue if query['queryType'] == 'segmentMetadata': continue elif query['queryType'] == 'union': - dataSource = "'" + query['query']['dataSource']['name'] + "'" - queryId = query['query']['context']['queryId'] + dataSource = "'" + query['dataSource']['name'] + "'" + queryId = query['context']['queryId'] + try: + priority = query['context']['priority'] + except: + priority = 'Null' + intervals = query['intervals']['intervals'] + elif query['queryType'] == 'groupBy': + if query['dataSource']['type'] == 'union': + dataSource = "'" + query['dataSource']['dataSources'][0]['name'] + "|" + query['dataSource']['dataSources'][1]['name'] + "'" + else: + dataSource = "'" + query['dataSource']['name'] + "'" + queryId = query['context']['queryId'] try: priority = query['query']['context']['priority'] except: priority = 'Null' - intervals = query['query']['intervals']['intervals'] + intervals = query['intervals']['intervals'] else: if query['dataSource']['type'] == 'table': try: