add a monitor flag, and make the regex matching existing lines more
strict, and make the flags field optional.