Right now, I am using this line of code to get rid of data in a file called alarmNotificati on that I do not want:
[code=unix]
egrep "low debug.*\".*\"" $dbDir/alarmNotificati on.log
[/code]
but I am having some problem. An entry like the one below in the alarmNotificati on.log file is getting deleted when I only want a part of the entry to be deleted, keeping the rest of the line in tact
[code=data]
low debug 2009/3/9 8:30:21.01 ICSNotification Alarm Prodics01ics000 3 IC "1.0^AB^A4600^A 1236605421010^A 15906^A15902^A1 ^Am[0]=15901^Acom.cbo e.exceptions.Da taValidationExc eption,IDL:exce ptions/DataValidationE xception:1.0 com.cboe.except ions.OrderBookT radableNotFound Exception: No tradables in book at specified price: 610712901:SUN:B UY,com.cboe.exc eptions.DataVal idationExceptio n: IDL:exceptions/DataValidationE xception:1.0 com.cboe.except ions.OrderBookT radableNotFound Exception: No tradables in book at specified price: 610712901:SUN:B UY
at com.cboe.util.E xceptionBuilder .dataValidation Exception(Excep tionBuilder.jav a:99)
at com.cboe.busine ssServices.brok erService.Broke rProcessorBase. processUpdate(B rokerProcessorB ase.java:2467)
at com.cboe.busine ssServices.brok erService.Broke rProcessorHybri dImpl.processUp date(BrokerProc essorHybridImpl .java:2388)
at com.cboe.busine ssServices.brok erService.Accep tQuoteUpdateCom mand.doExecute( AcceptQuoteUpda teCommand.java: 109)
at com.cboe.busine ssServices.brok erService.Broke rCommand.execut e(BrokerCommand .java:111)
at com.cboe.server .commandProcess ing.TradingClas sBlockCommandSi ngleThreadImpl. acceptCommands( TradingClassBlo ckCommandSingle ThreadImpl.java :27)
at com.cboe.server .commandProcess ing.TradingClas sBlockCommand.p rocessBlock(Tra dingClassBlockC ommand.java:203 )
at com.cboe.server .commandProcess ing.TradingClas sBlockCommand.e xecute(TradingC lassBlockComman d.java:146)
at com.cboe.server .commandProcess ing.TradingClas sCommandQueuePr ocessor.run(Tra dingClassComman dQueueProcessor .java:51)
at java.lang.Threa d.run(Thread.ja va:619),^AProdBC04x1Hyb ridTradeServer1 prdbc04a^AHybri dTradeServer1^A " 0
[/code]
I want this entry to look like this after I correct the problem:
[code=data]
low debug 2009/3/9 8:30:21.01 ICSNotification Alarm Prodics01ics000 3 IC "1.0^AB^A4600^A 1236605421010^A 15906^A15902^A1 ^Am[0]=15901^Acom.cbo e.exceptions.Da taValidationExc eption,IDL:exce ptions/DataValidationE xception:1.0 com.cboe.except ions.OrderBookT radableNotFound Exception: No tradables in book at specified price: 610712901:SUN:B UY,com.cboe.exc eptions.DataVal idationExceptio n: IDL:exceptions/DataValidationE xception:1.0 com.cboe.except ions.OrderBookT radableNotFound Exception: No tradables in book at specified price: 610712901:SUN:B UY^AProdBC04x1H ybridTradeServe r1prdbc04a^AHyb ridTradeServer1 ^A" 0
[/code]
entries like these dont get effected at all by the egrep line:
[code=data]
low debug 2009/3/9 8:30:18.05 ICSNotification Alarm Prodics01ics000 3 IC "1.0^AB^A4589^A 1236605418050^A 23605^A23603^A2 ^Am[0]=23601^A60^APro dcas01v2cas0102 ^APOATP/CASQuote^A" 0
low debug 2009/3/9 8:30:19.52 ICSNotification Alarm Prodics01ics000 3 IC "1.0^AB^A4590^A 1236605419520^A 23906^A23904^A2 ^Am[0]=23902^A<FINE> <org.apache.act ivemq.broker.re gion.TopicSubsc ription> < Mon 2009/03/09 08:30:15:380 > <org.apache.act ivemq.broker.re gion.TopicSubsc ription.add> <Thread[ActiveMQ Transport: tcp:///127.0.0.1:64770 ,4,main]> Discarding state cleared, delta-discarded(727). TopicSubscripti on: consumer=ID:mdg c01a-47174-1236574999518-0:126:1:2, destination=top ic:///ProdRecap/IDL:consumers/RecapConsumer:1 .0---RecapLocalMD01---local, destinations=1, dispatchedQueue =1171, delivered=57018 4, matched=0, discarded=742^A ProdAMQBrokermd gc01a.out^AProd LogWatchermdgc0 1a^A" 0
[/code]
Instead of an egrep, is there a global substitute or something that I could do.
thanks
[code=unix]
egrep "low debug.*\".*\"" $dbDir/alarmNotificati on.log
[/code]
but I am having some problem. An entry like the one below in the alarmNotificati on.log file is getting deleted when I only want a part of the entry to be deleted, keeping the rest of the line in tact
[code=data]
low debug 2009/3/9 8:30:21.01 ICSNotification Alarm Prodics01ics000 3 IC "1.0^AB^A4600^A 1236605421010^A 15906^A15902^A1 ^Am[0]=15901^Acom.cbo e.exceptions.Da taValidationExc eption,IDL:exce ptions/DataValidationE xception:1.0 com.cboe.except ions.OrderBookT radableNotFound Exception: No tradables in book at specified price: 610712901:SUN:B UY,com.cboe.exc eptions.DataVal idationExceptio n: IDL:exceptions/DataValidationE xception:1.0 com.cboe.except ions.OrderBookT radableNotFound Exception: No tradables in book at specified price: 610712901:SUN:B UY
at com.cboe.util.E xceptionBuilder .dataValidation Exception(Excep tionBuilder.jav a:99)
at com.cboe.busine ssServices.brok erService.Broke rProcessorBase. processUpdate(B rokerProcessorB ase.java:2467)
at com.cboe.busine ssServices.brok erService.Broke rProcessorHybri dImpl.processUp date(BrokerProc essorHybridImpl .java:2388)
at com.cboe.busine ssServices.brok erService.Accep tQuoteUpdateCom mand.doExecute( AcceptQuoteUpda teCommand.java: 109)
at com.cboe.busine ssServices.brok erService.Broke rCommand.execut e(BrokerCommand .java:111)
at com.cboe.server .commandProcess ing.TradingClas sBlockCommandSi ngleThreadImpl. acceptCommands( TradingClassBlo ckCommandSingle ThreadImpl.java :27)
at com.cboe.server .commandProcess ing.TradingClas sBlockCommand.p rocessBlock(Tra dingClassBlockC ommand.java:203 )
at com.cboe.server .commandProcess ing.TradingClas sBlockCommand.e xecute(TradingC lassBlockComman d.java:146)
at com.cboe.server .commandProcess ing.TradingClas sCommandQueuePr ocessor.run(Tra dingClassComman dQueueProcessor .java:51)
at java.lang.Threa d.run(Thread.ja va:619),^AProdBC04x1Hyb ridTradeServer1 prdbc04a^AHybri dTradeServer1^A " 0
[/code]
I want this entry to look like this after I correct the problem:
[code=data]
low debug 2009/3/9 8:30:21.01 ICSNotification Alarm Prodics01ics000 3 IC "1.0^AB^A4600^A 1236605421010^A 15906^A15902^A1 ^Am[0]=15901^Acom.cbo e.exceptions.Da taValidationExc eption,IDL:exce ptions/DataValidationE xception:1.0 com.cboe.except ions.OrderBookT radableNotFound Exception: No tradables in book at specified price: 610712901:SUN:B UY,com.cboe.exc eptions.DataVal idationExceptio n: IDL:exceptions/DataValidationE xception:1.0 com.cboe.except ions.OrderBookT radableNotFound Exception: No tradables in book at specified price: 610712901:SUN:B UY^AProdBC04x1H ybridTradeServe r1prdbc04a^AHyb ridTradeServer1 ^A" 0
[/code]
entries like these dont get effected at all by the egrep line:
[code=data]
low debug 2009/3/9 8:30:18.05 ICSNotification Alarm Prodics01ics000 3 IC "1.0^AB^A4589^A 1236605418050^A 23605^A23603^A2 ^Am[0]=23601^A60^APro dcas01v2cas0102 ^APOATP/CASQuote^A" 0
low debug 2009/3/9 8:30:19.52 ICSNotification Alarm Prodics01ics000 3 IC "1.0^AB^A4590^A 1236605419520^A 23906^A23904^A2 ^Am[0]=23902^A<FINE> <org.apache.act ivemq.broker.re gion.TopicSubsc ription> < Mon 2009/03/09 08:30:15:380 > <org.apache.act ivemq.broker.re gion.TopicSubsc ription.add> <Thread[ActiveMQ Transport: tcp:///127.0.0.1:64770 ,4,main]> Discarding state cleared, delta-discarded(727). TopicSubscripti on: consumer=ID:mdg c01a-47174-1236574999518-0:126:1:2, destination=top ic:///ProdRecap/IDL:consumers/RecapConsumer:1 .0---RecapLocalMD01---local, destinations=1, dispatchedQueue =1171, delivered=57018 4, matched=0, discarded=742^A ProdAMQBrokermd gc01a.out^AProd LogWatchermdgc0 1a^A" 0
[/code]
Instead of an egrep, is there a global substitute or something that I could do.
thanks
Comment