What FTP server software are you using? Some have an "ftpwho"
command that will give you a list of who is logged in at any
given moment. That would be easily parseable.
Short of that you'll probably have to write a script parse the
logfile format looking for the username, which will also depend
on which FTP server you use, and probably be more complex
than the ftpwho method.