Im having trouble extracting only a matching string: OPER^ from a log4j file.
I can get this value from two different sources inside my log file:
2012-01-26 03:06:45,428 INFO [NP_OSS] OSSBSSGWIMPL6000|**OPR20120126120537008893**|GenServiceDeactivationResponse :: processRequestGenServiceDeactivationResponse() ::
or:
2012-01-26 03:06:45,411 INFO [NP_OSS] MESSAGE_DATA = <?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:ServiceDeactivationResponse xmlns:ns2="urn:ngn:foo"><MessageHeader><MessageTimeStamp>20120126031123</MessageTimeStamp>**<OperatorTrxID>OPR20120126120537008893</OperatorTrxID>**</MessageHeader></ns2:ServiceDeactivationResponse>
I need to extract only the value OPR*
I’m guessing its much easier to extract it from the first one since it doesn’t involve parsing xml.
Thanks a lot in advance for your help!
Edit:
After reading your comment: