%3CLINGO-SUB%20id%3D%22lingo-sub-258156%22%20slang%3D%22en-US%22%3EUsing%20PowerShell%20for%20Message%20Analyzer%20Text%20Log%20Parsers%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-258156%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSTRONG%3E%20First%20published%20on%20TechNet%20on%20Aug%2016%2C%202015%20%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHi%20Everyone%2C%20Brandon%20Wilson%20here%20with%20you%20again%20to%20discuss%20how%20to%20use%20PowerShell%20to%20generate%20parsed%20data%20output%20for%20log%20files%20for%20Message%20Analyzer%20(otherwise%20known%20as%20.matp%20files).%20Today%20we%20will%20focus%20on%20the%20text%20log%20parsers%20available%20as%20of%20Message%20Analyzer%201.3.1%2C%20so%20depending%20on%20the%20version%20you%20are%20running%2C%20you%20may%20or%20may%20not%20see%20all%20of%20the%20text%20log%20parsers%20mentioned%20within%20this%20blog.%20I%20HIGHLY%20recommend%20updating%20to%20Message%20Analyzer%201.3.1%20as%20soon%20as%20possible%20though%2C%20as%20there%20are%20a%20lot%20of%20improvements%20to%20be%20had!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20this%20walkthrough%2C%20we%20will%20cover%20the%20following%3A%3C%2FP%3E%0A%3CP%3E%3CA%3E%20Saving%20your%20output%20through%20the%20GUI%20%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CA%3E%20Available%20text%20log%20parsers%20%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CA%3E%20Known%20issues%20%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CA%3E%20What%20commands%20do%20I%20need%3F%20%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CA%3E%20Opening%20your%20output%20%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CA%3E%20Reference%20links%20%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1564618006%22%20id%3D%22toc-hId-1564618006%22%3ESaving%20your%20output%20through%20the%20GUI%3C%2FH3%3E%0A%3CP%3EOnce%20you%20open%20your%20log%20file%20within%20Message%20Analyzer%20directly%2C%20you%20have%20the%20ability%20to%20save%20the%20output%20as%20a%20.matp%20file.%20What%20this%20does%20is%20generate%20an%20output%20file%2C%20with%20the%20.matp%20extension%2C%20that%20is%20already%20parsed.%20This%20provides%20two%20major%20advantages%3A%3C%2FP%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3E1.%20You%20don%E2%80%99t%20have%20to%20wait%20for%20parsing%20to%20complete%20if%20you%20need%20to%20review%2Fanalyze%20the%20file%20again%20(or%20provide%20it%20to%20someone%20else)%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3E2.%20In%20most%20cases%2C%20the%20file%20size%20is%20reduced%20vs.%20the%20original%20input%20file%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20is%20a%20pretty%20simple%20thing%20to%20accomplish.%20Here%E2%80%99s%20a%20quick%20rundown%3A%3C%2FP%3E%0A%3CP%3E1.%20Open%20Message%20Analyzer%3C%2FP%3E%0A%3CP%3E2.%20Open%20the%20log%20file%20you%20wish%20to%20parse%20(I%20will%20use%20a%20Netlogon%20log%20in%20this%20example)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%3E%20%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F52484iB7DD59EB8E713CBF%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20%2F%3E%3C%2FSPAN%3E%20%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E3.%20Click%20the%20Save%20button%20in%20the%20top%20ribbon%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%3E%20%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F52485i2FDAC920DF94C937%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20%2F%3E%3C%2FSPAN%3E%20%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E4.%20In%20the%20save%20window%20that%20pops%20up%2C%20select%20either%20%E2%80%9CAll%20Messages%E2%80%9D%20or%20%E2%80%9CFiltered%20Messages%20for%20Analysis%20Grid%20view%E2%80%9D%20(depending%20on%20if%20you%20want%20to%20save%20just%20a%20portion%20you%E2%80%99ve%20filtered%20which%20is%20showing%20in%20the%20analysis%20grid%20or%20if%20you%20want%20to%20save%20all%20messages).%20After%20making%20that%20selection%2C%20click%20the%20%E2%80%9CSave%20As%E2%80%9D%20button%20in%20order%20to%20save%20the%20file%20as%20a%20.matp%20file.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%3E%20%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20568px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F52486iC1CAFA30B7EEE386%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20%2F%3E%3C%2FSPAN%3E%20%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E5.%20Specify%20a%20path%20and%20file%20name%20for%20the%20output%20file%20(the%20default%20will%20be%20the%20session%20number%3B%20for%20example%2C%20%E2%80%9CSession%201.matp%E2%80%9D)%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAnd%20that%E2%80%99s%20all%20there%20is%20to%20it%E2%80%A6%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--987538955%22%20id%3D%22toc-hId--987538955%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId-755271380%22%20id%3D%22toc-hId-755271380%22%3EAvailable%20text%20log%20parsers%3C%2FH3%3E%0A%3CP%3EThere%20are%20a%20number%20of%20text%20log%20parsers%20available%20for%20your%20use.%20I%20am%20not%20going%20to%20cover%20these%20in%20depth%20within%20this%20blog%2C%20but%20I%20did%20want%20to%20provide%20you%20with%20the%20options%20you%20have%20available.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%3E%20%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20956px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F52487iDAD50C22E1917079%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20%2F%3E%3C%2FSPAN%3E%20%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESo%20even%20though%20its%20shown%20above%20in%20the%20screen%20shot%2C%20let%E2%80%99s%20take%20a%20look%20at%20what%20we%20have%20here.%20Most%20of%20these%20are%20pretty%20self-explanatory%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3E1.%20CheckSymCSV%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3E2.%20Cluster%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3E3.%20Dcdiag%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3E4.%20DPMRegistry%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3E5.%20EventLogCSV%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3E6.%20IIS%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3E7.%20LSP%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3E8.%20LYNC%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3E9.%20Netlogon%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3E10.%20SambaSysLog%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3E11.%20SCCM%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3E12.%20SQLServerError%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3E13.%20SQLServerSetup%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3E14.%20ULS%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3E15.%20VMM%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3E16.%20DefaultSimpleLogFileReaderConfig%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CH3%20id%3D%22toc-hId--1796885581%22%20id%3D%22toc-hId--1796885581%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId--54075246%22%20id%3D%22toc-hId--54075246%22%3EKnown%20issues%3C%2FH3%3E%0A%3CP%3EThere%20are%20a%20couple%20of%20known%20issues%20that%20have%20occurred%20over%20time%2C%20and%20to%20be%20honest%2C%20I%20don%E2%80%99t%20know%20that%20I%20would%20actually%20call%20them%20issues%20(except%20for%20the%20first%20one).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3E1.%20There%20was%20a%20regression%20in%20Message%20Analyzer%201.3%20that%20prevented%20PowerShell%20text%20log%20parsing%20from%20functioning%20properly.%20This%20has%20been%20fixed%20in%20Message%20Analyzer%201.3.1.%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3E2.%20Parsing%20performance%20may%20be%20a%20little%20slower%20in%20PowerShell%20vs.%20using%20the%20GUI.%20This%20is%20in%20part%20because%20PowerShell%20is%20not%20only%20parsing%20the%20data%2C%20but%20it%20is%20also%20saving%20the%20.matp%20output%20file.%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CH3%20id%3D%22toc-hId-1688735089%22%20id%3D%22toc-hId-1688735089%22%3E%26nbsp%3B%3C%2FH3%3E%0A%3CH3%20id%3D%22toc-hId--863421872%22%20id%3D%22toc-hId--863421872%22%3EWhat%20commands%20do%20I%20need%3F%3C%2FH3%3E%0A%3CP%3EFor%20this%20example%2C%20we%20will%20use%20a%20Netlogon%20log%20named%20DC1-netlogon.log.%20Fortunately%2C%20parsing%20in%20PowerShell%20is%20pretty%20straightforward%2C%20even%20for%20me.%20In%20the%20example%2C%20I%20will%20show%20you%20a%20way%20to%20run%20the%20necessary%20PowerShell%20commands%20and%20pipe%20it%20out%20to%20a%20file%20the%20old%20school%20way%2C%20as%20well%20as%20log%20the%20performance%2Fruntime%20of%20the%20command%20itself%20(just%20in%20case%20you%E2%80%99re%20interested%20in%20such%20things).%20Just%20as%20a%20reminder%2C%20you%20can%20save%20any%20of%20these%20via%20the%20PowerShell%20ISE%2C%20or%20even%20via%20notepad%2C%20as%20a%20.ps1%20file.%20That%20file%20can%20then%20be%20ran%20either%20through%20the%20PowerShell%20ISE%2C%20or%20via%20the%20PowerShell%20prompt%20by%20using%20the%20%E2%80%9C.%5Cscriptname.ps1%E2%80%9D%20syntax%20(no%20quotes).%20The%20same%20methods%20below%20apply%20to%20all%20the%20text%20log%20parsers%20available%20through%20Message%20Analyzer.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESo%2C%20what%20do%20we%20ACTUALLY%20need%20to%20do%20(in%20the%20barest%20form)%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3E1.%20First%2C%20we%20need%20to%20specify%20a%20trace%20session%20and%20provide%20a%20path%20for%20the%20.matp%20output%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3E2.%20Second%2C%20we%20need%20to%20provide%20the%20path%20to%20the%20log%20file%2C%20as%20well%20as%20the%20text%20log%20parser%20we%20want%20to%20use%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CBLOCKQUOTE%3E%0A%3CP%3E3.%20Third%2C%20we%20need%20to%20actually%20run%20the%20command%20to%20begin%20parsing%20using%20the%20input%20provided%20in%20steps%201%20%26amp%3B%202%3C%2FP%3E%0A%3C%2FBLOCKQUOTE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESo%2C%20a%20simplistic%20example%20could%20be%20this%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%24TraceSession01%20%3D%20New-PefTraceSession%20-Force%20-Path%20B%3A%5Ctemp%5CDC1-Netlogon.matp%20-SaveOnStop%3C%2FP%3E%0A%3CP%3EAdd-PefMessageSource%20-PEFSession%20%24TraceSession01%20-Provider%20%22B%3A%5Ctemp%5CDC1-Netlogon.log%22%20-LogConfig%20Netlogon%3C%2FP%3E%0A%3CP%3EStart-PefTraceSession%20-PEFSession%20%24TraceSession01%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThat%E2%80%99s%20it%3B%20nice%20and%20simple%20right!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%2C%20let%E2%80%99s%20say%20we%20want%20to%20track%20the%20performance%20and%20write%20the%20performance%20details%20to%20an%20output%20file%20(which%20is%20handy%20if%20you%20running%20commands%20against%20multiple%20files%2C%20or%20of%20course%2C%20if%20you%E2%80%99re%20just%20curious).%3C%2FP%3E%0A%3CP%3ESo%2C%20showing%20you%20a%20view%20of%20the%20PowerShell%20ISE%20for%20just%20one%20example%20against%20a%20single%20Netlogon%20log%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%3E%20%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F52488iEDC375785AA1BA0B%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20%2F%3E%3C%2FSPAN%3E%20%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20you%20can%20see%20in%20the%20above%20example%2C%20I%20am%20doing%20a%20basic%20echo%20command%20to%20tell%20me%20which%20file%20(in%20this%20case%2C%20which%20domain%20controller)%20I%E2%80%99m%20parsing%20and%20providing%20that%20to%20a%20file%20named%20Netlogon-tracking.txt%20located%20in%20the%20B%3A%5Ctemp%20directory.%20Next%2C%20because%20I%20like%20to%20know%20my%20start%20(and%20end)%20times%2C%20I%20do%20a%20simple%20get-date%20PowerShell%20command%20to%20output%20the%20date%20and%20time%20when%20the%20command%20started%20(and%20ended).%20At%20that%20point%20I%20kick%20off%20the%20actual%20meat%20of%20the%20script%2C%20except%20unlike%20the%20basic%20example%2C%20I%20threw%20a%20measure-command%20PowerShell%20command%20into%20the%20mix%20in%20order%20to%20evaluate%20the%20run%20times%20when%20the%20script%20is%20actually%20kicked%20off.%20After%20all%20of%20that%2C%20I%20simply%20throw%20a%20couple%20of%20blank%20lines%20in%20to%20get%20ready%20for%20any%20other%20data%20I%20might%20want%20to%20parse%20as%20well.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EObviously%2C%20all%20of%20these%20extras%20are%20optional%20and%20aren%E2%80%99t%20really%20needed%2C%20but%20I%20wanted%20to%20show%20you%20some%20of%20the%20flexibility%20here.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20reference%2C%20this%20is%20the%20type%20of%20output%20that%20the%20%E2%80%9Cmeasure-command%E2%80%9D%20PowerShell%20command%20will%20get%20you%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EDC1-Netlogon.log...%3C%2FP%3E%0A%3CP%3EFriday%2C%20July%2024%2C%202015%2011%3A07%3A41%20AM%3C%2FP%3E%0A%3CP%3EDays%20%3A%200%3C%2FP%3E%0A%3CP%3EHours%20%3A%200%3C%2FP%3E%0A%3CP%3EMinutes%20%3A%200%3C%2FP%3E%0A%3CP%3ESeconds%20%3A%2018%3C%2FP%3E%0A%3CP%3EMilliseconds%20%3A%20660%3C%2FP%3E%0A%3CP%3ETicks%20%3A%20186609256%3C%2FP%3E%0A%3CP%3ETotalDays%20%3A%200.000215982935185185%3C%2FP%3E%0A%3CP%3ETotalHours%20%3A%200.00518359044444444%3C%2FP%3E%0A%3CP%3ETotalMinutes%20%3A%200.311015426666667%3C%2FP%3E%0A%3CP%3ETotalSeconds%20%3A%2018.6609256%3C%2FP%3E%0A%3CP%3ETotalMilliseconds%20%3A%2018660.9256%3C%2FP%3E%0A%3CP%3EFriday%2C%20July%2024%2C%202015%2011%3A08%3A06%20AM%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%2C%20let%E2%80%99s%20say%20I%20want%20to%20expand%20on%20this%20parsing%20and%20review%202%20domain%20controllers%20and%20an%20Exchange%20server%E2%80%99s%20Netlogon%20log.%20Basically%2C%20this%20is%20the%20same%20as%20above%2C%20except%20we%20are%20calling%20out%20more%20files.%20Let%E2%80%99s%20take%20a%20look%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-879388463%22%20id%3D%22toc-hId-879388463%22%3E%3CA%3E%20%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F52489i89C5FBBC608A6164%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20%2F%3E%3C%2FSPAN%3E%20%3C%2FA%3E%3C%2FH3%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--1672768498%22%20id%3D%22toc-hId--1672768498%22%3EOpening%20your%20output%3C%2FH3%3E%0A%3CP%3EOpening%20the%20.matp%20output%20file%20is%20as%20simple%20as%20can%20be.%20All%20you%20need%20to%20do%20is%20double%20click%20the%20file%20to%20open%20it%2C%20or%20of%20course%20you%20can%20right%20click%20and%20select%20Open%20(or%20Open%20With)%2C%20or%20you%20can%20open%20it%20in%20Message%20Analyzer%20directly%20using%20the%20File%20menu.%20Whatever%20method%20you%20choose%2C%20when%20you%20open%20the%20output%20file%2C%20the%20Message%20Analyzer%20GUI%20will%20open%2C%20and%20you%20will%20be%20presented%20with%20the%20already%20parsed%20output%20file%20(as%20seen%20in%20the%20below%20screenshot).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-70041837%22%20id%3D%22toc-hId-70041837%22%3E%3CA%3E%20%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F52490i14695B4356326184%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20%2F%3E%3C%2FSPAN%3E%20%3C%2FA%3E%3C%2FH3%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1097690883%22%20id%3D%22toc-hId-1097690883%22%3EReference%20links%3C%2FH3%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CI%3E%20Diving%20into%20the%20Netlogon%20Parser%20(v3.5)%20for%20Message%20Analyzer%20%3C%2FI%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fcore-infrastructure-and-security%2Fdiving-into-the-netlogon-parser-v3-5-for-message-analyzer%2Fba-p%2F258140%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fcore-infrastructure-and-security%2Fdiving-into-the-netlogon-parser-v3-5-for-message-analyzer%2Fba-p%2F258140%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CI%3E%20New%20Features%20in%20the%20Netlogon%20Parser%20(v1.1.4)%20for%20Message%20Analyzer%20%3C%2FI%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fcore-infrastructure-and-security%2Fnew-features-in-the-netlogon-parser-v1-1-4-for-message-analyzer%2Fba-p%2F257723%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fcore-infrastructure-and-security%2Fnew-features-in-the-netlogon-parser-v1-1-4-for-message-analyzer%2Fba-p%2F257723%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CI%3E%20Introducing%20the%20Netlogon%20Parser%20(v1.0.1)%20for%20Message%20Analyzer%201.1%20(By%3A%20Brandon%20Wilson)%20%3C%2FI%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fcore-infrastructure-and-security%2Fintroducing-the-netlogon-parser-v1-0-1-for-message-analyzer-1-1%2Fba-p%2F257535%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fcore-infrastructure-and-security%2Fintroducing-the-netlogon-parser-v1-0-1-for-message-analyzer-1-1%2Fba-p%2F257535%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CI%3E%20Troubleshooting%20Basics%20for%20the%20Netlogon%20Parser%20(v1.0.1)%20for%20Message%20Analyzer%20(By%3A%20Brandon%20Wilson)%20%3C%2FI%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fcore-infrastructure-and-security%2Ftroubleshooting-basics-for-the-netlogon-parser-v1-0-1-for%2Fba-p%2F257611%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fcore-infrastructure-and-security%2Ftroubleshooting-basics-for-the-netlogon-parser-v1-0-1-for%2Fba-p%2F257611%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CI%3E%20Quick%20Reference%3A%20Troubleshooting%20Netlogon%20Error%20Codes%20(By%3A%20Brandon%20Wilson)%20%3C%2FI%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fcore-infrastructure-and-security%2Fquick-reference-troubleshooting-netlogon-error-codes%2Fba-p%2F256000%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fcore-infrastructure-and-security%2Fquick-reference-troubleshooting-netlogon-error-codes%2Fba-p%2F256000%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CI%3E%20Quick%20Reference%3A%20Troubleshooting%2C%20Diagnosing%2C%20and%20Tuning%20MaxConcurrentApi%20Issues%20(By%3A%20Brandon%20Wilson)%20%3C%2FI%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fcore-infrastructure-and-security%2Fquick-reference-troubleshooting-diagnosing-and-tuning%2Fba-p%2F256868%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fcore-infrastructure-and-security%2Fquick-reference-troubleshooting-diagnosing-and-tuning%2Fba-p%2F256868%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThat%20about%20sums%20up%20today%E2%80%99s%20blog.%20Can%20you%20believe%20I%20wrote%20something%20this%20short%20(I%20know%20I%20hardly%20can)!%20Thanks%20for%20reading%2C%20and%20as%20always%2C%20I%E2%80%99ll%20talk%20to%20you%20next%20time%20around!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E-Brandon%20Wilson%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-258156%22%20slang%3D%22en-US%22%3E%3CP%3EFirst%20published%20on%20TechNet%20on%20Aug%2016%2C%202015%20-%20Hi%20Everyone%2C%20Brandon%20Wilson%20here%20with%20you%20again%20to%20discuss%20how%20to%20use%20PowerShell%20to%20generate%20parsed%20data%20output%20for%20log%20files%20for%20Message%20Analyzer%20(otherwise%20known%20as%20.matp%20files).%20Today%20we%20will%20focus%20on%20the%20text%20log%20parsers%20available%20as%20of%20Message%20Analyzer%201.3.1%2C%20so%20depending%20on%20the%20version%20you%20are%20running%2C%20you%20may%20or%20may%20not%20see%20all%20of%20the%20text%20log%20parsers%20mentioned%20within%20this%20blog.%20I%20HIGHLY%20recommend%20updating%20to%20Message%20Analyzer%201.3.1%20as%20soon%20as%20possible%20though%2C%20as%20there%20are%20a%20lot%20of%20improvements%20to%20be%20had!%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-258156%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EBrandonWilson%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

First published on TechNet on Aug 16, 2015

 

 

Hi Everyone, Brandon Wilson here with you again to discuss how to use PowerShell to generate parsed data output for log files for Message Analyzer (otherwise known as .matp files). Today we will focus on the text log parsers available as of Message Analyzer 1.3.1, so depending on the version you are running, you may or may not see all of the text log parsers mentioned within this blog. I HIGHLY recommend updating to Message Analyzer 1.3.1 as soon as possible though, as there are a lot of improvements to be had!

 

In this walkthrough, we will cover the following:

Saving your output through the GUI

Available text log parsers

Known issues

What commands do I need?

Opening your output

Reference links

 

 

Saving your output through the GUI

Once you open your log file within Message Analyzer directly, you have the ability to save the output as a .matp file. What this does is generate an output file, with the .matp extension, that is already parsed. This provides two major advantages:

1. You don’t have to wait for parsing to complete if you need to review/analyze the file again (or provide it to someone else)

2. In most cases, the file size is reduced vs. the original input file

 

This is a pretty simple thing to accomplish. Here’s a quick rundown:

1. Open Message Analyzer

2. Open the log file you wish to parse (I will use a Netlogon log in this example)

 

 

3. Click the Save button in the top ribbon

 

 

4. In the save window that pops up, select either “All Messages” or “Filtered Messages for Analysis Grid view” (depending on if you want to save just a portion you’ve filtered which is showing in the analysis grid or if you want to save all messages). After making that selection, click the “Save As” button in order to save the file as a .matp file.

 

 

5. Specify a path and file name for the output file (the default will be the session number; for example, “Session 1.matp”)

 

And that’s all there is to it…

 

Available text log parsers

There are a number of text log parsers available for your use. I am not going to cover these in depth within this blog, but I did want to provide you with the options you have available.

 

 

So even though its shown above in the screen shot, let’s take a look at what we have here. Most of these are pretty self-explanatory:

 

1. CheckSymCSV

2. Cluster

3. Dcdiag

4. DPMRegistry

5. EventLogCSV

6. IIS

7. LSP

8. LYNC

9. Netlogon

10. SambaSysLog

11. SCCM

12. SQLServerError

13. SQLServerSetup

14. ULS

15. VMM

16. DefaultSimpleLogFileReaderConfig

 

Known issues

There are a couple of known issues that have occurred over time, and to be honest, I don’t know that I would actually call them issues (except for the first one).

 

1. There was a regression in Message Analyzer 1.3 that prevented PowerShell text log parsing from functioning properly. This has been fixed in Message Analyzer 1.3.1.

2. Parsing performance may be a little slower in PowerShell vs. using the GUI. This is in part because PowerShell is not only parsing the data, but it is also saving the .matp output file.

 

What commands do I need?

For this example, we will use a Netlogon log named DC1-netlogon.log. Fortunately, parsing in PowerShell is pretty straightforward, even for me. In the example, I will show you a way to run the necessary PowerShell commands and pipe it out to a file the old school way, as well as log the performance/runtime of the command itself (just in case you’re interested in such things). Just as a reminder, you can save any of these via the PowerShell ISE, or even via notepad, as a .ps1 file. That file can then be ran either through the PowerShell ISE, or via the PowerShell prompt by using the “.\scriptname.ps1” syntax (no quotes). The same methods below apply to all the text log parsers available through Message Analyzer.

 

So, what do we ACTUALLY need to do (in the barest form):

 

1. First, we need to specify a trace session and provide a path for the .matp output

2. Second, we need to provide the path to the log file, as well as the text log parser we want to use

3. Third, we need to actually run the command to begin parsing using the input provided in steps 1 & 2

 

So, a simplistic example could be this:

 

$TraceSession01 = New-PefTraceSession -Force -Path B:\temp\DC1-Netlogon.matp -SaveOnStop

Add-PefMessageSource -PEFSession $TraceSession01 -Provider "B:\temp\DC1-Netlogon.log" -LogConfig Netlogon

Start-PefTraceSession -PEFSession $TraceSession01

 

That’s it; nice and simple right!

 

Now, let’s say we want to track the performance and write the performance details to an output file (which is handy if you running commands against multiple files, or of course, if you’re just curious).

So, showing you a view of the PowerShell ISE for just one example against a single Netlogon log:

 

 

As you can see in the above example, I am doing a basic echo command to tell me which file (in this case, which domain controller) I’m parsing and providing that to a file named Netlogon-tracking.txt located in the B:\temp directory. Next, because I like to know my start (and end) times, I do a simple get-date PowerShell command to output the date and time when the command started (and ended). At that point I kick off the actual meat of the script, except unlike the basic example, I threw a measure-command PowerShell command into the mix in order to evaluate the run times when the script is actually kicked off. After all of that, I simply throw a couple of blank lines in to get ready for any other data I might want to parse as well.

 

Obviously, all of these extras are optional and aren’t really needed, but I wanted to show you some of the flexibility here.

 

For reference, this is the type of output that the “measure-command” PowerShell command will get you:

 

DC1-Netlogon.log...

Friday, July 24, 2015 11:07:41 AM

Days : 0

Hours : 0

Minutes : 0

Seconds : 18

Milliseconds : 660

Ticks : 186609256

TotalDays : 0.000215982935185185

TotalHours : 0.00518359044444444

TotalMinutes : 0.311015426666667

TotalSeconds : 18.6609256

TotalMilliseconds : 18660.9256

Friday, July 24, 2015 11:08:06 AM

 

Now, let’s say I want to expand on this parsing and review 2 domain controllers and an Exchange server’s Netlogon log. Basically, this is the same as above, except we are calling out more files. Let’s take a look:

 

 

Opening your output

Opening the .matp output file is as simple as can be. All you need to do is double click the file to open it, or of course you can right click and select Open (or Open With), or you can open it in Message Analyzer directly using the File menu. Whatever method you choose, when you open the output file, the Message Analyzer GUI will open, and you will be presented with the already parsed output file (as seen in the below screenshot).

 

 

Reference links

 

Diving into the Netlogon Parser (v3.5) for Message Analyzer

https://techcommunity.microsoft.com/t5/core-infrastructure-and-security/diving-into-the-netlogon-par...

 

New Features in the Netlogon Parser (v1.1.4) for Message Analyzer

https://techcommunity.microsoft.com/t5/core-infrastructure-and-security/new-features-in-the-netlogon...

 

Introducing the Netlogon Parser (v1.0.1) for Message Analyzer 1.1 (By: Brandon Wilson)

https://techcommunity.microsoft.com/t5/core-infrastructure-and-security/introducing-the-netlogon-par...

 

Troubleshooting Basics for the Netlogon Parser (v1.0.1) for Message Analyzer (By: Brandon Wilson)

https://techcommunity.microsoft.com/t5/core-infrastructure-and-security/troubleshooting-basics-for-t...

 

Quick Reference: Troubleshooting Netlogon Error Codes (By: Brandon Wilson)

https://techcommunity.microsoft.com/t5/core-infrastructure-and-security/quick-reference-troubleshoot...

 

Quick Reference: Troubleshooting, Diagnosing, and Tuning MaxConcurrentApi Issues (By: Brandon Wilson)

https://techcommunity.microsoft.com/t5/core-infrastructure-and-security/quick-reference-troubleshoot...

 

 

That about sums up today’s blog. Can you believe I wrote something this short (I know I hardly can)! Thanks for reading, and as always, I’ll talk to you next time around!

 

-Brandon Wilson