<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_output_fields(self):
 """ Get field names from output template. """

        # Re-engineer list from output format
        # XXX TODO: Would be better to use a FieldRecorder class to catch the full field names
        emit_fields = list(i.lower() for i in re.sub(r"[^_A-Z]+", ' ', self.format_item(None)).split())

        # Validate result
        result = []
        for name in emit_fields[:]:
            if name not in engine.FieldDefinition.FIELDS:
                self.LOG.warn("Omitted unknown name '%s' from statistics and output format sorting" % name)
            else:
                result.append(name)

        return result