Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created on 05-29-2014 04:38 AM - edited 05-29-2014 04:39 AM
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
Created 05-29-2014 05:31 AM
Created 05-29-2014 05:31 AM
Created on 05-29-2014 07:23 AM - edited 05-29-2014 11:39 AM
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 : [
{ ... }
{ ... }
]
}
}
}
]
}