Class ELFLogFormat

  • All Implemented Interfaces:
    LogFormat

    public class ELFLogFormat
    extends Object
    implements LogFormat
    Describes the format of a web server log in W3C Extended log format. The format pattern is a #Fields directive that specifies the fields.
    • Constructor Detail

      • ELFLogFormat

        public ELFLogFormat()
        Create a log format for accessing Extended Log Format data.
      • ELFLogFormat

        public ELFLogFormat​(String formatPattern)
        Create a log format for accessing Extended Log Format data.
        Parameters:
        formatPattern - the fields directive that defines the schema
    • Method Detail

      • getFormatPattern

        public String getFormatPattern()
        Get the value used for the log format pattern
        Specified by:
        getFormatPattern in interface LogFormat
        Returns:
        the text value of the format pattern
      • setFormatPattern

        public void setFormatPattern​(String formatPattern)
        Set the value used for the log format pattern
        Specified by:
        setFormatPattern in interface LogFormat
        Parameters:
        formatPattern - the value to use as the format pattern
      • refreshSchema

        protected void refreshSchema()
      • getLogType

        public SupportedLogType getLogType()
        Description copied from interface: LogFormat
        Get the SupportedLogType of this format.
        Specified by:
        getLogType in interface LogFormat
        Returns:
        the SupportedLogType this format implements
      • getSchema

        public RecordTextSchema<?> getSchema()
        Gets the record schema of the source.
        Returns:
        the record schema of the source
      • 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.

        Specified by:
        getType in interface LogFormat
        Returns:
        the format's record type
      • isSplittable

        public boolean isSplittable()
        Description copied from interface: LogFormat
        Indicates if the format supports parsing of subsections of a file.

        A format should only return true if it can, at least in some situations, support this sort of parsing. If a format requires reading the entire file, it must return false.

        If a format is not splittable, a file in the format cannot be parsed in parallel; however, individual files can still be parsed independently in parallel, as when reading the contents of a directory or using a file globbing pattern.

        Specified by:
        isSplittable in interface LogFormat
        Returns:
        true if the format supports parsing only a portion of the file, false otherwise