SOLVED

Render Piechart

%3CLINGO-SUB%20id%3D%22lingo-sub-765265%22%20slang%3D%22en-US%22%3ERender%20Piechart%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-765265%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20All%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20want%20to%20create%20a%20pie%20chart%20that%20can%20populate%20the%20count%20of%20two%20types%20VMs%20that%20has%20either%20security%20or%20critical%20patch%20missing.%3C%2FP%3E%3CP%3ELike%20%3A%20-%20I%20have%2020%20VM%20and%2015%20have%20Critical%20patch%20missing%20whereas%205%20have%20security%20patch%20matching.%20So%20it%20will%20generate%20a%20pie%20chart%20with%20count%20of%20VM.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20scratched%20my%20head%20and%20tried%20to%20write%20Kusto%20for%20the%20same.%20But%20not%20sure%20how%20to%20count%20%22true%22%20in%20extended%20column.%20Or%20how%20to%20summarize%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3EUpdate%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Ewhere%3C%2FSPAN%3E%3CSPAN%3ETimeGenerated%20%26gt%3B%3D%20ago(%3C%2FSPAN%3E%3CSPAN%3E1%3C%2FSPAN%3E%3CSPAN%3Ed)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Ewhere%3C%2FSPAN%3E%3CSPAN%3E(Classification%20%3D%3D%20%3C%2FSPAN%3E%3CSPAN%3E%22Security%20Updates%22%3C%2FSPAN%3E%3CSPAN%3Eor%3C%2FSPAN%3E%3CSPAN%3EClassification%20%3D%3D%20%3C%2FSPAN%3E%3CSPAN%3E%22Critical%20Updates%22%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20extend%20sec_server%20%3D%20(Classification%20%3D%3D%20%22Security%20Updates%22)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20extend%20cri_server%20%3D%20(Classification%20%3D%3D%20%22Critical%20Updates%22)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%2F%2F%7C%20summarize%20count(Title)%20by%20Computer%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%2F%2F%7C%20project%20TimeGenerated%2C%20Title%2C%20Classification%2C%20Computer%2C%20Resource%2C%20UpdateState%2C%20Product%2C%20KBID%2C%20RebootBehavior%2C%20ResourceGroup%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%2F%2F%7C%20sort%20by%20count_Title%20desc%20%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%2F%2F%7C%20take%2010%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%2F%2F%7C%20render%20piechart%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3EClarifying%20it%20more%3A%20-%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3COL%3E%3CLI%3EThe%20number%20of%20servers%20that%20have%20one%20or%20more%20critical%20patches%20pending.%26nbsp%3B%20So%20if%20there%20are%20100%20servers%20that%20each%20have%20at%20least%20one%20critical%20patch%20pending%2C%20I%20would%20like%20to%20see%20the%20number%20100%20represented%20in%20a%20pie%20chart%20or%20bar%20graph%20format.%26nbsp%3B%20The%20actual%20number%20of%20critical%20patches%20pending%20is%20not%20the%20important%20number%2C%20the%20number%20of%20servers%20that%20are%20pending%20critical%20patches%20is%20the%20important%20number.%3C%2FLI%3E%3C%2FOL%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%202.%20The%20same%20representation%20as%20above%20for%20pending%20security%20patches%26nbsp%3B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EThanks%20in%20advance%20for%20the%20help%20%3A)%3C%2Fimg%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-765265%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Log%20Analytics%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-766547%22%20slang%3D%22en-US%22%3ERe%3A%20Render%20Piechart%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-766547%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F184511%22%20target%3D%22_blank%22%3E%40Gourav%20Kumar%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3EUpdate%0A%7C%20where%20TimeGenerated%20%26gt%3B%3D%20ago(1d)%0A%7C%20where%20(Classification%20%3D%3D%20%22Security%20Updates%22%20or%20Classification%20%3D%3D%20%22Critical%20Updates%22)%0A%7C%20summarize%20count(Classification)%20by%20Computer%0A%7C%20sort%20by%20count_Classification%20desc%20%3CBR%20%2F%3E%2F%2F%20render%20piechart%3C%2FPRE%3E%0A%3CP%3Eor%3C%2FP%3E%0A%3CPRE%3EUpdate%0A%7C%20where%20TimeGenerated%20%26gt%3B%3D%20ago(1d)%0A%7C%20where%20(Classification%20%3D%3D%20%22Security%20Updates%22%20or%20Classification%20%3D%3D%20%22Critical%20Updates%22)%0A%7C%20extend%20sec_server%20%3D%20(Classification%20%3D%3D%20%22Security%20Updates%22)%0A%7C%20extend%20cri_server%20%3D%20(Classification%20%3D%3D%20%22Critical%20Updates%22)%0A%7C%20summarize%20SecurityUpdate%20%3D%20count(sec_server)%2C%20CriticalUpdate%20%3D%20count(cri_server)%20by%20Computer%0A%7C%20sort%20by%20CriticalUpdate%20desc%20%2C%20SecurityUpdate%20desc%3CBR%20%2F%3E%2F%2F%20render%20barchart%3C%2FPRE%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3Eor%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3E%0A%3CPRE%3EUpdate%0A%7C%20where%20TimeGenerated%20%26gt%3B%3D%20ago(1d)%0A%7C%20where%20(Classification%20%3D%3D%20%22Security%20Updates%22%20or%20Classification%20%3D%3D%20%22Critical%20Updates%22)%0A%7C%20summarize%20ServerThatMatchCriteria%3Ddcount(Computer)%20%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-767035%22%20slang%3D%22en-US%22%3ERe%3A%20Render%20Piechart%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-767035%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F239477%22%20target%3D%22_blank%22%3E%40Clive%20Watson%3C%2FA%3E%26nbsp%3BThanks%20a%20lot%20sir%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENow%20I%20am%20bit%20stuck%20to%20represent%20this%20through%20a%20pie%20chart.%20As%20i%20want%20servers%20that%20have%20missing%20security%20update%20%26gt%3B1%20also%20critical%20update%20%26gt%3B%201.%20But%20when%20i%20thought%20about%20query%20found%20below%20hurdles%3A-%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20i%20will%20go%20by%20classification%20then%20this%20field%20either%20have%20Security%20Updates%20or%20Critical%20Updates.%20And%20if%20i%20will%20use%20below%20line%20in%20query%20then%20i%20will%20nothing%20in%20result%20since%20since%20field%20cannot%20hold%20both%20at%20a%20time.%3C%2FP%3E%3CDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%3CSTRONG%3EWrong%20One%3A%20-%3C%2FSTRONG%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Ewhere%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EClassificati%3C%2FSPAN%3E%3CSPAN%3Eon%3C%2FSPAN%3E%3CSPAN%3E%3D%3D%20%3C%2FSPAN%3E%3CSPAN%3E%22Security%20Updates%22%3C%2FSPAN%3E%26nbsp%3B%3CSTRONG%3Eand%3C%2FSTRONG%3E%26nbsp%3B%3CSPAN%3EClassificati%3C%2FSPAN%3E%3CSPAN%3Eon%3C%2FSPAN%3E%3CSPAN%3E%3D%3D%20%3C%2FSPAN%3E%3CSPAN%3E%22Critical%20Updates%22%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSTRONG%3ERight%20One%3A%20-%3C%2FSTRONG%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Ewhere%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EClassificati%3C%2FSPAN%3E%3CSPAN%3Eon%3C%2FSPAN%3E%3CSPAN%3E%3D%3D%20%3C%2FSPAN%3E%3CSPAN%3E%22Security%20Updates%22%3C%2FSPAN%3E%3CSTRONG%3E%3CSPAN%3Eor%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%3EClassificati%3C%2FSPAN%3E%3CSPAN%3Eon%3C%2FSPAN%3E%3CSPAN%3E%3D%3D%20%3C%2FSPAN%3E%3CSPAN%3E%22Critical%20Updates%22%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EBut%20this%20contains%20both%20due%20to%20its%20or%20condition.%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EI%20am%20using%20below%20query%20as%20of%20now%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3EUpdate%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Ewhere%3C%2FSPAN%3E%3CSPAN%3ETimeGenerated%20%26gt%3B%3D%20%3C%2FSPAN%3E%3CSPAN%3Eago%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3E1%3C%2FSPAN%3E%3CSPAN%3Ed%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Ewhere%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EClassificati%3C%2FSPAN%3E%3CSPAN%3Eon%3C%2FSPAN%3E%3CSPAN%3E%3D%3D%20%3C%2FSPAN%3E%3CSPAN%3E%22Security%20Updates%22%3C%2FSPAN%3E%3CSPAN%3Eor%3C%2FSPAN%3E%3CSPAN%3EClassificati%3C%2FSPAN%3E%3CSPAN%3Eon%3C%2FSPAN%3E%3CSPAN%3E%3D%3D%20%3C%2FSPAN%3E%3CSPAN%3E%22Critical%20Updates%22%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Ewhere%3C%2FSPAN%3E%3CSPAN%3EUpdate%3C%2FSPAN%3E%3CSPAN%3EState%3C%2FSPAN%3E%3CSPAN%3E%3D%3D%20%3C%2FSPAN%3E%3CSPAN%3E%22Needed%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Esummarize%3C%2FSPAN%3E%3CSPAN%3Edcount%3C%2FSPAN%3E%3CSPAN%3E(%3C%2FSPAN%3E%3CSPAN%3EComputer%3C%2FSPAN%3E%3CSPAN%3E)%20%3C%2FSPAN%3E%3CSPAN%3Eby%3C%2FSPAN%3E%3CSPAN%3EClassificati%3C%2FSPAN%3E%3CSPAN%3Eon%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Erender%3C%2FSPAN%3E%3CSPAN%3Epiechart%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EThis%20is%20generating%20similar%20output%20like%20as%20beneath%3A%20-%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%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%2F123978i8B0F701B4CF9F311%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20alt%3D%22TechNet_Dash_OMS_Update.JPG%22%20title%3D%22TechNet_Dash_OMS_Update.JPG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3EThis%20is%20good%20but%20%3CSTRONG%3EI%20want%20server%20that%20has%20Security%20Update%20missing%20%3CEM%3Eand%3C%2FEM%3E(%3CEM%3E%3CU%3Ehere%20i%20want%20and%20not%20or%20condition%3C%2FU%3E%3C%2FEM%3E)%20Critical%20Update%20missing.%3C%2FSTRONG%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3EThanks%20in%20advance%20%3A)%3C%2Fimg%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-767067%22%20slang%3D%22en-US%22%3ERe%3A%20Render%20Piechart%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-767067%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F184511%22%20target%3D%22_blank%22%3E%40Gourav%20Kumar%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20a%20table%2C%20this%20would%20work%20(not%20Pie%20chart)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3EUpdate%0A%7C%20where%20TimeGenerated%20%26gt%3B%3D%20ago(1d)%20%0A%7C%20where%20(Classification%20%3D%3D%20%22Security%20Updates%22%20or%20Classification%20%3D%3D%20%22Critical%20Updates%22)%20%0A%7C%20where%20UpdateState%20%3D%3D%20%22Needed%22%0A%7C%20summarize%20%20by%20Classification%2C%20Computer%0A%7C%20evaluate%20pivot(Classification)%3C%2FPRE%3E%0A%3CP%3Eor%20%2C%20this%20that%20allows%20you%20to%20see%20when%20%26gt%3B%201%20for%20the%20two%20columns%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3EUpdate%0A%7C%20where%20TimeGenerated%20%26gt%3B%3D%20ago(1d)%20%0A%7C%20where%20(Classification%20%3D%3D%20%22Security%20Updates%22%20or%20Classification%20%3D%3D%20%22Critical%20Updates%22)%20%0A%7C%20where%20UpdateState%20%3D%3D%20%22Needed%22%0A%7C%20extend%20su%20%3D%20iif(Classification%3D%3D%22Security%20Updates%22%2C%201%2C0)%20%0A%7C%20extend%20cu%20%3D%20iif(Classification%3D%3D%22Critical%20Updates%22%2C%201%2C0)%20%0A%7C%20summarize%20dcount(su)%2C%20dcount(cu)%20by%20Computer%0A%7C%20where%20dcount_cu%20%26gt%3B%201%20and%20dcount_su%20%26gt%3B%201%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-767591%22%20slang%3D%22en-US%22%3ERe%3A%20Render%20Piechart%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-767591%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F239477%22%20target%3D%22_blank%22%3E%40Clive%20Watson%3C%2FA%3E%26nbsp%3BThank%20you%20very%20much%20for%20the%20help.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESir%2C%20Is%20it%20possible%20to%20count%20server%20numbers%20that%20has%20security%20and%20Critical%20patches%20missing.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELike%2C%20I%20have%20total%2020%20servers%20and%2015%20has%20security%20and%208%20has%20critical%20patches%20missing.%20So%20i%20want%20server%20count%20that%20has%20both%20of%20patches%20missing.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3EUpdate%20%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Ewhere%3C%2FSPAN%3E%3CSPAN%3ETimeGenerated%20%26gt%3B%3D%20ago(%3C%2FSPAN%3E%3CSPAN%3E1%3C%2FSPAN%3E%3CSPAN%3Ed)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Ewhere%3C%2FSPAN%3E%3CSPAN%3E(Classification%20%3D%3D%20%3C%2FSPAN%3E%3CSPAN%3E%22Security%20Updates%22%3C%2FSPAN%3E%3CSPAN%3Eor%3C%2FSPAN%3E%3CSPAN%3EClassification%20%3D%3D%20%3C%2FSPAN%3E%3CSPAN%3E%22Critical%20Updates%22%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Ewhere%3C%2FSPAN%3E%3CSPAN%3EUpdateState%20%3D%3D%20%3C%2FSPAN%3E%3CSPAN%3E%22Needed%22%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Eextend%3C%2FSPAN%3E%3CSPAN%3Esu%20%3D%20iif(Classification%3D%3D%3C%2FSPAN%3E%3CSPAN%3E%22Security%20Updates%22%3C%2FSPAN%3E%3CSPAN%3E%2C%20%3C%2FSPAN%3E%3CSPAN%3E1%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E0%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Eextend%3C%2FSPAN%3E%3CSPAN%3Ecu%20%3D%20iif(Classification%3D%3D%3C%2FSPAN%3E%3CSPAN%3E%22Critical%20Updates%22%3C%2FSPAN%3E%3CSPAN%3E%2C%20%3C%2FSPAN%3E%3CSPAN%3E1%3C%2FSPAN%3E%3CSPAN%3E%2C%3C%2FSPAN%3E%3CSPAN%3E0%3C%2FSPAN%3E%3CSPAN%3E)%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Esummarize%3C%2FSPAN%3E%3CSPAN%3Edcount(su)%2C%20dcount(cu)%20%3C%2FSPAN%3E%3CSPAN%3Eby%3C%2FSPAN%3E%3CSPAN%3EComputer%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20%3C%2FSPAN%3E%3CSPAN%3Ewhere%3C%2FSPAN%3E%3CSPAN%3Edcount_cu%20%26gt%3B%20%3C%2FSPAN%3E%3CSPAN%3E1%3C%2FSPAN%3E%3CSPAN%3Eand%3C%2FSPAN%3E%3CSPAN%3Edcount_su%20%26gt%3B%20%3C%2FSPAN%3E%3CSPAN%3E1%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%7C%20project%20Computer%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSTRONG%3E%7C%20print%20Total_Server%20%3D%20count(project%20Computer)%3C%2FSTRONG%3E%3C%2FDIV%3E%3CDIV%3Ewhen%20I%20used%3CSTRONG%3Eproject%20Computer%20%3C%2FSTRONG%3Ethat%20populated%20all%20computer%20name.%20But%20I%20want%20total%20count%20of%20Computer%2C%20if%20somehow%20i%20can%20achieve%20this.%20That%20would%20be%20the%20best%20answer%20of%20my%20question.%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3EThanks%20in%20advance%20%3A)%3C%2Fimg%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-767626%22%20slang%3D%22en-US%22%3ERe%3A%20Render%20Piechart%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-767626%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F184511%22%20target%3D%22_blank%22%3E%40Gourav%20Kumar%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3EUpdate%20%0A%7C%20where%20TimeGenerated%20%26gt%3B%3D%20ago(1d)%20%0A%7C%20where%20(Classification%20%3D%3D%20%22Security%20Updates%22%20or%20Classification%20%3D%3D%20%22Critical%20Updates%22)%20%0A%7C%20where%20UpdateState%20%3D%3D%20%22Needed%22%0A%7C%20extend%20su%20%3D%20iif(Classification%3D%3D%22Security%20Updates%22%2C%201%2C0)%20%0A%7C%20extend%20cu%20%3D%20iif(Classification%3D%3D%22Critical%20Updates%22%2C%201%2C0)%20%0A%7C%20summarize%20dcount(su)%2C%20dcount(cu)%20by%20Computer%0A%7C%20where%20dcount_cu%20%26gt%3B%201%20and%20dcount_su%20%26gt%3B%201%0A%7C%20count%20%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-767662%22%20slang%3D%22en-US%22%3ERe%3A%20Render%20Piechart%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-767662%22%20slang%3D%22en-US%22%3E%3CP%3EAhh....%20I%20missed%20this%20simple%20thing.%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F239477%22%20target%3D%22_blank%22%3E%40Clive%20Watson%3C%2FA%3E%26nbsp%3BThanks%20a%20lot%20Sir%20for%20helping%20me%20here%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Contributor

Hi All,

 

I want to create a pie chart that can populate the count of two types VMs that has either security or critical patch missing.

Like : - I have 20 VM and 15 have Critical patch missing whereas 5 have security patch matching. So it will generate a pie chart with count of VM.

 

I have scratched my head and tried to write Kusto for the same. But not sure how to count "true" in extended column. Or how to summarize it.

 

Update
| where TimeGenerated >= ago(1d)
| where (Classification == "Security Updates" or Classification == "Critical Updates")
| extend sec_server = (Classification == "Security Updates")
| extend cri_server = (Classification == "Critical Updates")
 
//| summarize count(Title) by Computer
//| project TimeGenerated, Title, Classification, Computer, Resource, UpdateState, Product, KBID, RebootBehavior, ResourceGroup
//| sort by count_Title desc
//| take 10
//| render piechart
 
Clarifying it more: -
 
  1. The number of servers that have one or more critical patches pending.  So if there are 100 servers that each have at least one critical patch pending, I would like to see the number 100 represented in a pie chart or bar graph format.  The actual number of critical patches pending is not the important number, the number of servers that are pending critical patches is the important number.

 

    2. The same representation as above for pending security patches 
 
Thanks in advance for the help :)
6 Replies

@GouravIN 

 

Update
| where TimeGenerated >= ago(1d)
| where (Classification == "Security Updates" or Classification == "Critical Updates")
| summarize count(Classification) by Computer
| sort by count_Classification desc 
// render piechart

or

Update
| where TimeGenerated >= ago(1d)
| where (Classification == "Security Updates" or Classification == "Critical Updates")
| extend sec_server = (Classification == "Security Updates")
| extend cri_server = (Classification == "Critical Updates")
| summarize SecurityUpdate = count(sec_server), CriticalUpdate = count(cri_server) by Computer
| sort by CriticalUpdate desc , SecurityUpdate desc
// render barchart
 
or
 
Update
| where TimeGenerated >= ago(1d)
| where (Classification == "Security Updates" or Classification == "Critical Updates")
| summarize ServerThatMatchCriteria=dcount(Computer) 

 

@Clive Watson Thanks a lot sir,

 

Now I am bit stuck to represent this through a pie chart. As i want servers that have missing security update >1 also critical update > 1. But when i thought about query found below hurdles:- 

 

If i will go by classification then this field either have Security Updates or Critical Updates. And if i will use below line in query then i will nothing in result since since field cannot hold both at a time.

 
Wrong One: - | where (Classification == "Security Updates" and Classification == "Critical Updates")
Right One: -| where (Classification == "Security Updates" or Classification == "Critical Updates")
 
But this contains both due to its or condition.
I am using below query as of now
 
Update
| where TimeGenerated >= ago(1d)
| where (Classification == "Security Updates" or Classification == "Critical Updates")
| where UpdateState == "Needed"
| summarize dcount(Computer) by Classification
| render piechart
 
This is generating similar output like as beneath: -
TechNet_Dash_OMS_Update.JPG
 
This is good but I want server that has Security Update missing and (here i want and not or condition) Critical Update missing.
 
Thanks in advance :)

@GouravIN 

 

In a table, this would work (not Pie chart)

 

Update
| where TimeGenerated >= ago(1d) 
| where (Classification == "Security Updates" or Classification == "Critical Updates") 
| where UpdateState == "Needed"
| summarize  by Classification, Computer
| evaluate pivot(Classification)

or , this that allows you to see when > 1 for the two columns?

 

Update
| where TimeGenerated >= ago(1d) 
| where (Classification == "Security Updates" or Classification == "Critical Updates") 
| where UpdateState == "Needed"
| extend su = iif(Classification=="Security Updates", 1,0) 
| extend cu = iif(Classification=="Critical Updates", 1,0) 
| summarize dcount(su), dcount(cu) by Computer
| where dcount_cu > 1 and dcount_su > 1

 

 

@Clive Watson Thank you very much for the help.

 

Sir, Is it possible to count server numbers that has security and Critical patches missing.

 

Like, I have total 20 servers and 15 has security and 8 has critical patches missing. So i want server count that has both of patches missing.

 

Update
| where TimeGenerated >= ago(1d)
| where (Classification == "Security Updates" or Classification == "Critical Updates")
| where UpdateState == "Needed"
| extend su = iif(Classification=="Security Updates", 1,0)
| extend cu = iif(Classification=="Critical Updates", 1,0)
| summarize dcount(su), dcount(cu) by Computer
| where dcount_cu > 1 and dcount_su > 1
| project Computer
| print Total_Server = count(project Computer)
when I used project Computer that populated all computer name. But I want total count of Computer, if somehow i can achieve this. That would be the best answer of my question.
 
Thanks in advance :)
best response confirmed by GouravIN (Contributor)
Solution

@GouravIN 

 

Update 
| where TimeGenerated >= ago(1d) 
| where (Classification == "Security Updates" or Classification == "Critical Updates") 
| where UpdateState == "Needed"
| extend su = iif(Classification=="Security Updates", 1,0) 
| extend cu = iif(Classification=="Critical Updates", 1,0) 
| summarize dcount(su), dcount(cu) by Computer
| where dcount_cu > 1 and dcount_su > 1
| count 

Ahh.... I missed this simple thing.

@Clive Watson Thanks a lot Sir for helping me here :)