From 1d596736f387d06e114166538cb6a43fe3b40a82 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 10 Jul 2020 08:53:57 -0400 Subject: [PATCH] Tolerate : without a space E.g. grep does not space delimit. --- confluent_client/bin/collate | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/confluent_client/bin/collate b/confluent_client/bin/collate index 7d670390..07095901 100755 --- a/confluent_client/bin/collate +++ b/confluent_client/bin/collate @@ -88,15 +88,18 @@ while fullline: for line in fullline.split('\n'): if not line: continue - if ': ' not in line: + if ':' not in line: line = 'UNKNOWN: ' + line if options.log: - node, output = line.split(': ', 1) + node, output = line.split(':', 1) + output = output.lstrip() currlog = options.log.format(node=node, nodename=node) with open(currlog, mode='a') as log: log.write(output + '\n') continue - grouped.add_line(*line.split(': ', 1)) + node, output = line.split(':', 1) + output = output.lstrip() + grouped.add_line(node, output) if options.watch: if not holdoff: holdoff = os.times()[4] + 0.250