Home
%3CLINGO-SUB%20id%3D%22lingo-sub-453726%22%20slang%3D%22en-US%22%3EHow%20to%20query%20XMLs%20with%20namespaces%20as%20dynamic%20columns%20in%20Azure%20Data%20Explorer%20(Kusto)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-453726%22%20slang%3D%22en-US%22%3E%3CP%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20inherit%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20line-height%3A%201.7142%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20margin%3A%200in%200in%200pt%200in%3B%22%3E%3CFONT%20size%3D%224%22%20style%3D%22box-sizing%3A%20border-box%3B%22%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%22%3EXML%20parse%20into%20dynamic%20column%20can%20be%20done%20with%20%3CA%20style%3D%22background-color%3A%20transparent%3B%20box-sizing%3A%20border-box%3B%20color%3A%20%23146cac%3B%20text-decoration%3A%20underline%3B%22%20href%3D%22https%3A%2F%2Fkusto.azurewebsites.net%2Fdocs%2Fquery%2Fparse-xmlfunction.html%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23146cac%3B%20font-family%3A%20%26amp%3Bquot%3B%22%3Eparse_xml(x%3C%2FSPAN%3E%3C%2FA%3E).%26nbsp%3B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20inherit%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20line-height%3A%201.7142%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20margin%3A%200in%200in%200pt%200in%3B%22%3E%3CFONT%20size%3D%224%22%20style%3D%22box-sizing%3A%20border-box%3B%22%3E%3CSPAN%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20%26amp%3Bquot%3B%22%3EHere%20is%20a%20workaround%20to%20enable%20translation%20of%20XMLs%20with%20namespaces.%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20inherit%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20line-height%3A%201.7142%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20margin%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20style%3D%22background-color%3A%20%23f5f5f5%3B%20border-bottom-left-radius%3A%204px%3B%20border-bottom-right-radius%3A%204px%3B%20border-image-outset%3A%200%3B%20border-image-repeat%3A%20stretch%3B%20border-image-slice%3A%20100%25%3B%20border-image-source%3A%20none%3B%20border-image-width%3A%201%3B%20border-top-left-radius%3A%204px%3B%20border-top-right-radius%3A%204px%3B%20box-sizing%3A%20border-box%3B%20color%3A%20%233e3e3e%3B%20display%3A%20block%3B%20font-family%3A%20Menlo%2CMonaco%2CConsolas%2C%26amp%3Bquot%3B%20courier%20new%26amp%3Bquot%3B%2Cmonospace%3B%20font-size%3A%2013px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20line-height%3A%201.7142%3B%20orphans%3A%202%3B%20overflow%3A%20auto%3B%20overflow-wrap%3A%20break-word%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20pre%3B%20word-break%3A%20break-all%3B%20word-spacing%3A%200px%3B%20padding%3A%2011.5px%3B%20margin%3A%200px%200px%2012px%200px%3B%20border%3A%201px%20solid%20%23cccccc%3B%22%3Edatatable%20(dumpInput%3Astring)%0A%20%20%20%20%5B'%26lt%3BSOAP-ENV%3AEnvelope%20xmlns%3Ae%3D%22http%3A%2F%2Fwww.test.com%22%26gt%3B%26lt%3B%2FSOAP-ENV%3AEnvelope%26gt%3B'%5D%20%20%20%0A%7C%20extend%20x%20%3D%20replace(%22%26lt%3B(.%2B%3F)%3A%22%2C%20%40%22%26lt%3B%5C1%22%2C%20dumpInput)%0A%7C%20project%20s%3Dparse_xml(x)%0A%7C%20extend%20s%5B%22SOAP-ENVEnvelope%22%5D%5B%22%40xmlns%3Ae%22%5D%3C%2FPRE%3E%0A%3CP%20style%3D%22box-sizing%3A%20border-box%3B%20color%3A%20%23333333%3B%20font-family%3A%20inherit%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20line-height%3A%201.7142%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20margin%3A%200px%3B%22%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-453726%22%20slang%3D%22en-US%22%3E%3CP%3EHere%20is%20a%20workaround%20to%20query%20attributes%20as%20columns%20for%20XML%20with%20namespaces%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F108799i10D62D80345B3282%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22ADX_Tips.png%22%20title%3D%22ADX_Tips.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-453726%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Data%20Explorer%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-509429%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20query%20XMLs%20with%20namespaces%20as%20dynamic%20columns%20in%20Azure%20Data%20Explorer%20(Kusto)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-509429%22%20slang%3D%22en-US%22%3E%3CP%3ETesting%20delivery%20to%20distribution%20list%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-509442%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20query%20XMLs%20with%20namespaces%20as%20dynamic%20columns%20in%20Azure%20Data%20Explorer%20(Kusto)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-509442%22%20slang%3D%22en-US%22%3E%3CP%3ETesting%20posting%20from%20other%20users%3C%2FP%3E%3C%2FLINGO-BODY%3E

XML parse into dynamic column can be done with parse_xml(x). 

Here is a workaround to enable translation of XMLs with namespaces.

 

datatable (dumpInput:string)
    ['<SOAP-ENV:Envelope xmlns:e="http://www.test.com"></SOAP-ENV:Envelope>']   
| extend x = replace("<(.+?):", @"<\1", dumpInput)
| project s=parse_xml(x)
| extend s["SOAP-ENVEnvelope"]["@xmlns:e"]