Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Morphline command to parse xml

Morphline command to parse xml

Champion Alumni

Hi ,

I  hav ea case where I  store a soap message in a  hbase  cell.I  am then planning to use the morphlines to extract and index the relevant fields of the message into solr.The idea is to use  one of  xslt or xquery commands.Is this  a good approach and which one would you suggest.Is there a better approach to the whole message flow.

2 REPLIES 2
Highlighted

Re: Morphline command to parse xml

Expert Contributor
Yes, the xquery morphline command is intended for that.

Re: Morphline command to parse xml

Champion Alumni

Thank you :).So the output of my extractHbaseCell  command  should be the  the query String that I input to the  xpath command as I get it.can you point me to an example if you one .I have pasted the current conf which I am using below.It just extracts and loads into solr without any transformation.

 

 

 

 

morphlines : [
{
id : morphline
importCommands : ["com.cloudera.**", "com.ngdata.**"]

commands : [
{
extractHBaseCells {
mappings : [
{
inputColumn : "messages:*"
outputField : "cat"
type : string
source : value
}
]
}
}


{ logDebug { format : "output record: {}", args : ["@{}"] } }
]
}
]