Class GenericLogFormat

  • All Implemented Interfaces:
    LogFormat

    public class GenericLogFormat
    extends AbstractRegexLogFormat
    Describes the format of a generic log that can be parsed using a regular expression. The format pattern defines the regular expression used to parse the log.
    • Constructor Detail

      • GenericLogFormat

        public GenericLogFormat()
        Create a generic log format to read data using a regular expression.
      • GenericLogFormat

        public GenericLogFormat​(String formatPattern)
        Create a generic log format to read data using a regular expression
        Parameters:
        formatPattern - the regular expression used in parsing
    • Method Detail

      • setSchema

        public void setSchema​(RecordTextSchema<?> schema)
        Sets the record schema of the source. Must match the regular expression used for parsing.
        Parameters:
        schema - the expected record schema of the source
      • getGroupCount

        public int getGroupCount()
        Gets the number of matching groups in the format pattern.
        Returns:
        the number of matching groups
      • getPatternFlags

        public int getPatternFlags()
      • setPatternFlags

        public void setPatternFlags​(int patternFlags)
      • getFormatPrefix

        public String getFormatPrefix()
      • setFormatPrefix

        public void setFormatPrefix​(String formatPrefix)
      • getType

        public RecordTokenType getType()
        Description copied from interface: LogFormat
        Gets the record type associated with the format. Records produced by the associated parser or consumed by the associated formatter will be of this type.

        For many formats, this may be derived from a schema object describing the format layout.

        Returns:
        the format's record type