1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-17 00:07:37 +02:00

fix for multi-word remote

This commit is contained in:
Kelly Brazil
2023-10-23 15:14:28 -07:00
parent 81f721f1ab
commit 47d4335890

View File

@ -272,6 +272,12 @@ def parse(data, raw=False, quiet=False):
output_line['time'] = ' '.join([linedata.pop(0),
linedata.pop(0)])
# if the rest of the data is within parens, then it's the remote IP or console
if len(linedata) > 1 and ' '.join(linedata).startswith('(') and ' '.join(linedata).endswith(')'):
output_line['from'] = ' '.join(linedata)[1:-1]
raw_output.append(output_line)
continue
# if just one more field, then it's the remote IP
if len(linedata) == 1:
output_line['from'] = linedata[0].replace('(', '').replace(')', '')