Class ExtractGrok

java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processors.standard.ExtractGrok
All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent, org.apache.nifi.processor.Processor

@SupportsBatching @SideEffectFree @InputRequirement(INPUT_REQUIRED) @Tags({"grok","log","text","parse","delimit","extract"}) @CapabilityDescription("Evaluates one or more Grok Expressions against the content of a FlowFile, adding the results as attributes or replacing the content of the FlowFile with a JSON notation of the matched content") @WritesAttributes(@WritesAttribute(attribute="grok.XXX",description="When operating in flowfile-attribute mode, each of the Grok identifier that is matched in the flowfile will be added as an attribute, prefixed with \"grok.\" For example,if the grok identifier \"timestamp\" is matched, then the value will be added to an attribute named \"grok.timestamp\"")) @Restricted(restrictions=@Restriction(requiredPermission=REFERENCE_REMOTE_RESOURCES,explanation="Patterns can reference resources over HTTP")) public class ExtractGrok extends org.apache.nifi.processor.AbstractProcessor
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final String
     
    private final BlockingQueue<byte[]>
     
    static final org.apache.nifi.components.PropertyDescriptor
     
    private static final String
     
    static final org.apache.nifi.components.PropertyDescriptor
     
    static final String
     
    static final String
     
    private io.krakens.grok.api.Grok
     
    static final org.apache.nifi.components.PropertyDescriptor
     
    static final org.apache.nifi.components.PropertyDescriptor
     
    static final org.apache.nifi.components.PropertyDescriptor
     
    private final AtomicBoolean
     
    static final org.apache.nifi.components.PropertyDescriptor
     
    static final org.apache.nifi.components.PropertyDescriptor
     
    private static final List<org.apache.nifi.components.PropertyDescriptor>
     
    static final org.apache.nifi.processor.Relationship
     
    static final org.apache.nifi.processor.Relationship
     
    private static final Set<org.apache.nifi.processor.Relationship>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected Collection<org.apache.nifi.components.ValidationResult>
    customValidate(org.apache.nifi.components.ValidationContext validationContext)
     
    Set<org.apache.nifi.processor.Relationship>
     
    final List<org.apache.nifi.components.PropertyDescriptor>
     
    void
    onScheduled(org.apache.nifi.processor.ProcessContext context)
     
    void
     
    void
    onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session)
     

    Methods inherited from class org.apache.nifi.processor.AbstractProcessor

    onTrigger

    Methods inherited from class org.apache.nifi.processor.AbstractSessionFactoryProcessor

    getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue

    Methods inherited from class org.apache.nifi.components.AbstractConfigurableComponent

    equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validate

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.apache.nifi.components.ConfigurableComponent

    getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate

    Methods inherited from interface org.apache.nifi.processor.Processor

    isStateful, migrateProperties, migrateRelationships
  • Field Details

    • FLOWFILE_ATTRIBUTE

      public static final String FLOWFILE_ATTRIBUTE
      See Also:
    • FLOWFILE_CONTENT

      public static final String FLOWFILE_CONTENT
      See Also:
    • APPLICATION_JSON

      private static final String APPLICATION_JSON
      See Also:
    • DEFAULT_PATTERN_NAME

      private static final String DEFAULT_PATTERN_NAME
      See Also:
    • GROK_EXPRESSION

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

      public static final org.apache.nifi.components.PropertyDescriptor GROK_PATTERNS
    • KEEP_EMPTY_CAPTURES

      public static final org.apache.nifi.components.PropertyDescriptor KEEP_EMPTY_CAPTURES
    • DESTINATION

      public static final org.apache.nifi.components.PropertyDescriptor DESTINATION
    • CHARACTER_SET

      public static final org.apache.nifi.components.PropertyDescriptor CHARACTER_SET
    • MAX_BUFFER_SIZE

      public static final org.apache.nifi.components.PropertyDescriptor MAX_BUFFER_SIZE
    • NAMED_CAPTURES_ONLY

      public static final org.apache.nifi.components.PropertyDescriptor NAMED_CAPTURES_ONLY
    • PROPERTY_DESCRIPTORS

      private static final List<org.apache.nifi.components.PropertyDescriptor> PROPERTY_DESCRIPTORS
    • REL_MATCH

      public static final org.apache.nifi.processor.Relationship REL_MATCH
    • REL_NO_MATCH

      public static final org.apache.nifi.processor.Relationship REL_NO_MATCH
    • RELATIONSHIPS

      private static final Set<org.apache.nifi.processor.Relationship> RELATIONSHIPS
    • grok

      private volatile io.krakens.grok.api.Grok grok
    • bufferQueue

      private final BlockingQueue<byte[]> bufferQueue
    • keepEmptyCaputures

      private final AtomicBoolean keepEmptyCaputures
  • Constructor Details

    • ExtractGrok

      public ExtractGrok()
  • Method Details

    • getRelationships

      public Set<org.apache.nifi.processor.Relationship> getRelationships()
      Specified by:
      getRelationships in interface org.apache.nifi.processor.Processor
      Overrides:
      getRelationships in class org.apache.nifi.processor.AbstractSessionFactoryProcessor
    • getSupportedPropertyDescriptors

      public final List<org.apache.nifi.components.PropertyDescriptor> getSupportedPropertyDescriptors()
      Overrides:
      getSupportedPropertyDescriptors in class org.apache.nifi.components.AbstractConfigurableComponent
    • onStopped

      @OnStopped public void onStopped()
    • customValidate

      protected Collection<org.apache.nifi.components.ValidationResult> customValidate(org.apache.nifi.components.ValidationContext validationContext)
      Overrides:
      customValidate in class org.apache.nifi.components.AbstractConfigurableComponent
    • onScheduled

      @OnScheduled public void onScheduled(org.apache.nifi.processor.ProcessContext context) throws io.krakens.grok.api.exception.GrokException, IOException
      Throws:
      io.krakens.grok.api.exception.GrokException
      IOException
    • onTrigger

      public void onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) throws org.apache.nifi.processor.exception.ProcessException
      Specified by:
      onTrigger in class org.apache.nifi.processor.AbstractProcessor
      Throws:
      org.apache.nifi.processor.exception.ProcessException