Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

Ignoring a morphline error

avatar
Explorer

Hi...

 

Is there any way of ignoring an error in a morphline, which consists of a series of commands, without modiying the offending command to be more tolerant?

 

For example, if one of the commands is Grok and a large file is processed and somewhere in the file a record does not match the regular expression, the execution of the morphline stops. Is there any configuration option to allow it to continue?

 

Thanks,

 

PNS

 

1 ACCEPTED SOLUTION

avatar
Super Collaborator
2 REPLIES 2

avatar
Super Collaborator

avatar
Explorer

Thanks for the prompt answer!

 

Adding to the Morphlines Reference Guide, the tryRules block has to be placed inside the commands block, e.g.

 

morphlines : [
    {
        id : morphline1
        importCommands : ["org.kitesdk.**", "org.apache.solr.**"]

        commands : [
            {
                readLine {
                    charset : UTF-8
                }
            }

            {
                tryRules {
                    catchExceptions : false
                    throwExceptionIfAllRulesFailed : true

                    rules : [

                    # next rule of tryRules cmd:
                    {
                        commands : [
                          { ... }
                          { ... }
                        ]
                    }

                    # next rule of tryRules cmd:
                    {
                        commands : [
                          { ... }
                          { ... }
                        ]
                    }
                }
            }
         ]
     }