Class GrokReader

java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.controller.AbstractControllerService
All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent, org.apache.nifi.controller.ControllerService, RecordReaderFactory

@Tags({"grok","logs","logfiles","parse","unstructured","text","record","reader","regex","pattern","logstash"}) @CapabilityDescription("Provides a mechanism for reading unstructured text data, such as log files, and structuring the data so that it can be processed. The service is configured using Grok patterns. The service reads from a stream of data and splits each message that it finds into a separate Record, each containing the fields that are configured. If a line in the input does not match the expected message pattern, the line of text is either considered to be part of the previous message or is skipped, depending on the configuration, with the exception of stack traces. A stack trace that is found at the end of a log message is considered to be part of the previous message but is added to the \'stackTrace\' field of the Record. If a record has no stack trace, it will have a NULL value for the stackTrace field (assuming that the schema does in fact include a stackTrace field of type String). Assuming that the schema includes a \'_raw\' field of type String, the raw message will be included in the Record.") @Restricted(restrictions=@Restriction(requiredPermission=REFERENCE_REMOTE_RESOURCES,explanation="Patterns and Expressions can reference resources over HTTP")) public class GrokReader extends SchemaRegistryService implements RecordReaderFactory
  • Field Details

    • groks

      private volatile List<io.krakens.grok.api.Grok> groks
    • noMatchStrategy

      private volatile NoMatchStrategy noMatchStrategy
    • recordSchema

      private volatile RecordSchema recordSchema
    • recordSchemaFromGrok

      private volatile RecordSchema recordSchemaFromGrok
    • DEFAULT_PATTERN_NAME

      static final String DEFAULT_PATTERN_NAME
      See Also:
    • APPEND_TO_PREVIOUS_MESSAGE

      static final org.apache.nifi.components.AllowableValue APPEND_TO_PREVIOUS_MESSAGE
    • SKIP_LINE

      static final org.apache.nifi.components.AllowableValue SKIP_LINE
    • RAW_LINE

      static final org.apache.nifi.components.AllowableValue RAW_LINE
    • STRING_FIELDS_FROM_GROK_EXPRESSION

      static final org.apache.nifi.components.AllowableValue STRING_FIELDS_FROM_GROK_EXPRESSION
    • GROK_PATTERNS

      static final org.apache.nifi.components.PropertyDescriptor GROK_PATTERNS
    • GROK_EXPRESSION

      static final org.apache.nifi.components.PropertyDescriptor GROK_EXPRESSION
    • NO_MATCH_BEHAVIOR

      static final org.apache.nifi.components.PropertyDescriptor NO_MATCH_BEHAVIOR
  • Constructor Details

    • GrokReader

      public GrokReader()
  • Method Details