# ircp logs parser - developed by acidvegas in python (https://git.acid.vegas/ircp)
importjson
importos
importsys
defparse(line,raw):# TODO: finish adding custom outputs for certain fields
ifnotraw:
args=line.split()
numeric=args[1]
data=''.join(args[3:])
ifdata[:1]==':':
data=data[1:]
ifnumeric=='001'andlen(args)>=7anddata.lower().startswith('welcome to the '):
returnargs[6]
elifnumeric=='002'andlen(line.split('running version '))==2:
returnline.split('running version ')[1]
elifnumeric=='003':
check=[itemforitemin('This server was cobbled together ','This server was created ','This server has been started ','This server was last re(started) on ','This server was last (re)started on ')ifdata.startswith(item)]