lundi 9 décembre 2019

PowerShell : How to extract more than one line in poweshell

I am trying to extract all the blocks from a file starting with [date pattern and ending with ]]

[2019-11-22T01:58:57-05:00] [OBIPS] [TRACE:1] [] [saw.httpserver.response.headers] [ecid: 1e0c8a2d-f8ec-4bd8-8286-f90181d90867-00009770,0:1] [tid: 3692] [SI-Name: ] [IDD-Name: ] [IDD-GUID: ] [userId: ABC] Status Code: 200, Last-Modified: Fri, 22 Nov 2019 06:58:57 GMT, Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, Expires: 0, Cache-Control: no-store, Content-Disposition: attachment; filename="Customer.xlsx"[[
File:sawserverstream.cpp
Line:783
Location:
    saw.httpserver.response.headers
    saw.subsystems.portal.generatedashboardexcel
    saw.httpserver.processrequest
    saw.rpc.server.responder
    saw.rpc.server
    saw.rpc.server.handleConnection
    saw.rpc.server.dispatch
    saw.threadpool.socketrpcserver
    saw.threads
HttpCommand: generateDashboardExcel 
HttpArgs: Page='Page 1',Action='Print',DownloadId='1574405936736',_scid='7lNF6xWYgLq0*y3hFhKE',ClientStateXML='<sawst:envState xmlns:sawst="com.siebel.analytics.web/state/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlVersion="200811100"><sawst:container cid="d:dashboard" xsi:type="sawst:topLevelStateContainer" persistPageState="true"><sawst:container cid="p:09astr18h713rk5c" xsi:type="sawst:page" firstVisit="true"><sawst:container cid="s:7u4r54h5mo2pmv6k" xsi:type="sawst:section" rendered="true"><sawst:container cid="g:uka3gbgdcbgk9smp" xsi:type="sawst:dashprompt" links="-" promptAutoCompleteState="off"/></sawst:container><sawst:container cid="r:fo9bhpb7la8arrhl" xsi:type="sawst:report" links="mfrde" defaultView="compoundView!2" searchId="lfquc3j3phd9nn2fa5jhg18lg2" folder="/shared/Usage Tracking/Dashboard Usage and Performance" itemName="Report - Average Statistics Performance Tiles"/><sawst:container cid="r:upplqpsdc6dm1kon" xsi:type="sawst:report" links="mfrde" defaultView="compoundView!1" searchId="e89h706oo58o2m689hfp5o1nhu" folder="/shared/SW Dashboard Notes/Reports" itemName="Dashboard Notes"/><sawst:container cid="r:964t1h403ekd5k14" xsi:type="sawst:report" links="mfrd" defaultView="compoundView!1" searchId="8ucib5s0pag7v15g28moshdnle" folder="/shared/SW Service/Customer" itemName="Customer Health Summary"/><sawst:container cid="r:p8g7c99eleu2hrv0" xsi:type="sawst:report" links="mfrd" defaultView="compoundView!3" searchId="u64sgcgmhkf6e1bj4vggdohkrq" folder="/shared/SW Service/Customer" itemName="Customer Health Details"/><sawst:container cid="r:ukfs7njir0i28q15" xsi:type="sawst:report" links="mfrd" defaultView="compoundView!1" searchId="01mdglkiu106hhjqdsvak2rk7u" folder="/shared/SW Service/Customer" itemName="SR and SPR Details"/><sawst:container cid="r:r3l2rhdi57am294f" xsi:type="sawst:report" links="mfrd" defaultView="compoundView!1" searchId="rtrtadgpl1k9t2fvgn4fjthntq" folder="/shared/SW Service/Customer" itemName="Customer Lookup Report2"/><sawst:container cid="r:ulaifrtp9m585n49" xsi:type="sawst:report" links="mfrd" defaultView="compoundView!4" searchId="u64sgcgmhkf6e1bj4vggdohkrq" folder="/shared/SW Service/Customer" itemName="Customer Health Details"/><sawst:container cid="r:i8lrjpqh2ffbff6i" xsi:type="sawst:report" links="mfrd" defaultView="compoundView!2" searchId="01mdglkiu106hhjqdsvak2rk7u" folder="/shared/SW Service/Customer" itemName="SR and SPR Details"/><sawst:container cid="s:4njahr0o9m70t5b5" xsi:type="sawst:section" rendered="true"/><sawst:container cid="s:kjade9nfrsj5ejgf" xsi:type="sawst:section" rendered="true"/><sawst:container cid="s:kp845ul9kbp6r187" xsi:type="sawst:section" rendered="true"/><sawst:container cid="s:7b2qg4vg8j9t0for" xsi:type="sawst:section" rendered="true"/><sawst:container cid="s:h4lkkp8t74kqoufe" xsi:type="sawst:section" rendered="true"/><sawst:container cid="s:1pa24fnhkm67nmpu" xsi:type="sawst:section" rendered="true"/><sawst:container cid="s:qvdenvfudlv0k2o6" xsi:type="sawst:section" rendered="true"/></sawst:container><sawst:container cid="f:dpstate" xsi:type="sawst:dashpromptstate" statepoolId="2sg3llprvmbr0ome92764rpdqu"/></sawst:container></sawst:envState>',PortalPath='/shared/SW Service/_portal/Customer',ViewState='5mt1bv4sj7gkuq02pfspd38lce' 
AuthProps: AuthSchema=UidPwd|PWD=******|UID=ABC|User=ABC|GUID=ABC
SessionID: 0:0:0:0:0:0:0:1.2f.n22ig25 
RemoteIP: 0:0:0:0:0:0:0:1 
SIKey: ssi 
]]

Aucun commentaire:

Enregistrer un commentaire