Reply
Highlighted
Champion Alumni
Posts: 160
Registered: ‎02-11-2014

Morphline command to parse xml

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.

Cloudera Employee
Posts: 146
Registered: ‎08-21-2013

Re: Morphline command to parse xml

Yes, the xquery morphline command is intended for that.

Champion Alumni
Posts: 160
Registered: ‎02-11-2014

Re: Morphline command to parse xml

[ Edited ]

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 : ["@{}"] } }
]
}
]

 

 

Announcements
The Kite SDK is a collection of docs, sample code, APIs, and tools to make Hadoop application development faster. Learn more at http://kitesdk.org.