Challenges in finding and copying the block


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Challenges in finding and copying the block
# 1  
Old 06-10-2013
RedHat Challenges in finding and copying the block

Hi, I have a below challenging task where iam unable to find the block and copy the same into a file.

I tried my luck,howver iam unable to reach the first and second step..Can anyone help me with a clue or with the commands so that i can give a try.

1. search the <number>9966993366</number> and find the jobid which is Job-107544
2. Once u find the jobid copy the starting of the line to till the other jobid starts.


Ex-1

2013 Jan 23 09:12:02:716 IST +0 BW.TEST-2-Process_Archive Debug [BW-User] DEBUG Job-107544 [UtilityService
s/BWFLIB_Logging/BWFLIB_getLogger.process/GA_WL_LOGDEBUG]: Wed, Jan 23, 2013, 09:12:02 698[1111732318]::
LogMessage::CallSYs1AndSystem2SubProcess:: CallSystem1AndSystem2SubProcess.Start.1Process Started
ProcessID:: 107544
ProjectName:: TEST-2_root
EngineName:: TEST-2-Process_Archive
RestartedFromCheckpoint:: false
TrackingInfo:: System2ServicevCustomerRequest-382_1358932322623
CustomId:: 192.168.248.250:6961937c:13a2b960ad6:-7ffd

2013 Jan 23 09:12:02:746 IST +0 BW.TEST-2-Process_Archive Debug [BW-User] DEBUG Job-107544 [UtilityService
s/BWFLIB_Logging/BWFLIB_getLogger.process/GA_WL_LOGDEBUG]: Wed, Jan 23, 2013, 09:12:02 728[1111732318]::
SendSubject::TEST.GB.COMPANY1.System1Adapter.Request._Null_.vCustomer.1
ReplySubject:: _INBOX
TrackingInfo:: System2ServicevCustomerRequest-382_1358932322623
OriginalMessage:: <?xml version="1.0" encoding="UTF-8"?>
<H1GGGGSS_SPR_VERIFY_CUSTOMER_INPUT><ser>H1GGGGSS_SPR_VERIFY_CUST_INP</ser><number>9966993366</number><ACCOUNT_ID>9400048048</ACCOUNT_ID><HOUSE_NUMBER/><HOUSE_NAME/><POSTCODE/><DOB/></H1GGGGSS_SPR_VERIFY_CUSTOMER_INPUT>

2013 Jan 23 09:12:04:564 IST +0 BW.TEST-2-Process_Archive Debug [BW-User] DEBUG Job-107544 [UtilityService
s/BWFLIB_Logging/BWFLIB_getLogger.process/GA_WL_LOGDEBUG]: Wed, Jan 23, 2013, 09:12:04 545[1111732318]::
SendSubject::_INBOXSystem1Adapter.Request._Null_.vCustomer.1
ReplySubject:: NULL
TrackingInfo:: System2ServicevCustomerRequest-382_1358932322623
OriginalMessage:: <?xml version="1.0" encoding="UTF-8"?>
<ns0:Response xmlns:ns0="http://www.tibco.com/xmlns/ae2xsd/2002/05/ae/System1/Response"><CUSTOMER__KEY><
number>9966993366</number><ACCOUNT__ID>9400048048</ACCOUNT__ID><CRM__ID>10000000000000052604</CRM__ID></CUSTOMER__KEY><STATU
S><STATUS__CODE>0</STATUS__CODE><ERROR__CODE/><ERROR__DESCRIPTION/></STATUS></ns0:Response>
2013 Jan 23 09:12:02:716 IST +0 BW.TEST-2-Process_Archive Debug [BW-User] DEBUG Job-107544 [UtilityService
s/BWFLIB_Logging/BWFLIB_getLogger.process/GA_WL_LOGDEBUG]: Wed, Jan 23, 2013, 09:12:02 698[1111732318]::
LogMessage::CallSYs1AndSystem2SubProcess:: CallSystem1AndSystem2SubProcess.Start.1Process Started
ProcessID:: 107544
ProjectName:: TEST-2_root
EngineName:: TEST-2-Process_Archive
RestartedFromCheckpoint:: false
TrackingInfo:: System2ServicevCustomerRequest-382_1358932322623
CustomId:: 192.168.248.250:6961937c:13a2b960ad6:-7ffd

2013 Jan 23 09:12:02:746 IST +0 BW.TEST-2-Process_Archive Debug [BW-User] DEBUG Job-107544 [UtilityService
s/BWFLIB_Logging/BWFLIB_getLogger.process/GA_WL_LOGDEBUG]: Wed, Jan 23, 2013, 09:12:02 728[1111732318]::
SendSubject::TEST.GB.COMPANY1.System1Adapter.Request._Null_.vCustomer.1
ReplySubject:: _INBOX
TrackingInfo:: System2ServicevCustomerRequest-382_1358932322623
OriginalMessage:: <?xml version="1.0" encoding="UTF-8"?>
<H1GGGGSS_SPR_VERIFY_CUSTOMER_INPUT><ser>H1GGGGSS_SPR_VERIFY_CUST_INP</ser><number>9966993366</number><ACCOUNT_ID>9400048048</ACCOUNT_ID><HOUSE_NUMBER/><HOUSE_NAME/><POSTCODE/><DOB/></H1GGGGSS_SPR_VERIFY_CUSTOMER_INPUT>

2013 Jan 23 09:12:04:564 IST +0 BW.TEST-2-Process_Archive Debug [BW-User] DEBUG Job-107567 [UtilityService
s/BWFLIB_Logging/BWFLIB_getLogger.process/GA_WL_LOGDEBUG]: Wed, Jan 23, 2013, 09:12:04 545[1111732318]::
SendSubject::_INBOXSystem1Adapter.Request._Null_.vCustomer.1
ReplySubject:: NULL
TrackingInfo:: System2ServicevCustomerRequest-382_1358932322623
OriginalMessage:: <?xml version="1.0" encoding="UTF-8"?>
<ns0:Response xmlns:ns0="http://www.tibco.com/xmlns/ae2xsd/2002/05/ae/System1/Response"><CUSTOMER__KEY><
number>9966993366</number><ACCOUNT__ID>9400048048</ACCOUNT__ID><CRM__ID>10000000000000052604</CRM__ID></CUSTOMER__KEY><STATU
S><STATUS__CODE>0</STATUS__CODE><ERROR__CODE/><ERROR__DESCRIPTION/></STATUS></ns0:Response>

In this example the result should be the below
result:
------
2013 Jan 23 09:12:02:716 IST +0 BW.TEST-2-Process_Archive Debug [BW-User] DEBUG Job-107544 [UtilityService
s/BWFLIB_Logging/BWFLIB_getLogger.process/GA_WL_LOGDEBUG]: Wed, Jan 23, 2013, 09:12:02 698[1111732318]::
LogMessage::CallSYs1AndSystem2SubProcess:: CallSystem1AndSystem2SubProcess.Start.1Process Started
ProcessID:: 107544
ProjectName:: TEST-2_root
EngineName:: TEST-2-Process_Archive
RestartedFromCheckpoint:: false
TrackingInfo:: System2ServicevCustomerRequest-382_1358932322623
CustomId:: 192.168.248.250:6961937c:13a2b960ad6:-7ffd

2013 Jan 23 09:12:02:746 IST +0 BW.TEST-2-Process_Archive Debug [BW-User] DEBUG Job-107544 [UtilityService
s/BWFLIB_Logging/BWFLIB_getLogger.process/GA_WL_LOGDEBUG]: Wed, Jan 23, 2013, 09:12:02 728[1111732318]::
SendSubject::TEST.GB.COMPANY1.System1Adapter.Request._Null_.vCustomer.1
ReplySubject:: _INBOX
TrackingInfo:: System2ServicevCustomerRequest-382_1358932322623
OriginalMessage:: <?xml version="1.0" encoding="UTF-8"?>
<H1GGGGSS_SPR_VERIFY_CUSTOMER_INPUT><ser>H1GGGGSS_SPR_VERIFY_CUST_INP</ser><number>9966993366</number><ACCOUNT_ID>9400048048</ACCOUNT_ID><HOUSE_NUMBER/><HOUSE_NAME/><POSTCODE/><DOB/></H1GGGGSS_SPR_VERIFY_CUSTOMER_INPUT>

2013 Jan 23 09:12:04:564 IST +0 BW.TEST-2-Process_Archive Debug [BW-User] DEBUG Job-107544 [UtilityService
s/BWFLIB_Logging/BWFLIB_getLogger.process/GA_WL_LOGDEBUG]: Wed, Jan 23, 2013, 09:12:04 545[1111732318]::
SendSubject::_INBOXSystem1Adapter.Request._Null_.vCustomer.1
ReplySubject:: NULL
TrackingInfo:: System2ServicevCustomerRequest-382_1358932322623
OriginalMessage:: <?xml version="1.0" encoding="UTF-8"?>
<ns0:Response xmlns:ns0="http://www.tibco.com/xmlns/ae2xsd/2002/05/ae/System1/Response"><CUSTOMER__KEY><
number>9966993366</number><ACCOUNT__ID>9400048048</ACCOUNT__ID><CRM__ID>10000000000000052604</CRM__ID></CUSTOMER__KEY><STATU
S><STATUS__CODE>0</STATUS__CODE><ERROR__CODE/><ERROR__DESCRIPTION/></STATUS></ns0:Response>
2013 Jan 23 09:12:02:716 IST +0 BW.TEST-2-Process_Archive Debug [BW-User] DEBUG Job-107544 [UtilityService
s/BWFLIB_Logging/BWFLIB_getLogger.process/GA_WL_LOGDEBUG]: Wed, Jan 23, 2013, 09:12:02 698[1111732318]::
LogMessage::CallSYs1AndSystem2SubProcess:: CallSystem1AndSystem2SubProcess.Start.1Process Started
ProcessID:: 107544
ProjectName:: TEST-2_root
EngineName:: TEST-2-Process_Archive
RestartedFromCheckpoint:: false
TrackingInfo:: System2ServicevCustomerRequest-382_1358932322623
CustomId:: 192.168.248.250:6961937c:13a2b960ad6:-7ffd

2013 Jan 23 09:12:02:746 IST +0 BW.TEST-2-Process_Archive Debug [BW-User] DEBUG Job-107544 [UtilityService
s/BWFLIB_Logging/BWFLIB_getLogger.process/GA_WL_LOGDEBUG]: Wed, Jan 23, 2013, 09:12:02 728[1111732318]::
SendSubject::TEST.GB.COMPANY1.System1Adapter.Request._Null_.vCustomer.1
ReplySubject:: _INBOX
TrackingInfo:: System2ServicevCustomerRequest-382_1358932322623
OriginalMessage:: <?xml version="1.0" encoding="UTF-8"?>
<H1GGGGSS_SPR_VERIFY_CUSTOMER_INPUT><ser>H1GGGGSS_SPR_VERIFY_CUST_INP</ser><number>9966993366</number><ACCOUNT_ID>9400048048</ACCOUNT_ID><HOUSE_NUMBER/><HOUSE_NAME/><POSTCODE/><DOB/></H1GGGGSS_SPR_VERIFY_CUSTOMER_INPUT>
# 2  
Old 06-10-2013
Confused...

9966993366
exists multiple times in the file you showed.
But always with the same Debug Job.

Strangely, that search string appear in every one of the data paragraphs.

So, confused....
# 3  
Old 06-11-2013
clarification

Hi joeyg,

Yes..You are right..the 9966993366 comes more than once.In real time the logs are huge and it comes with different jobids as well. probably in the below example I should give the last block with different <number> value.

But here the main objective of using the value <number>9966993366</number> is to find the job-id which is "107544" and then use the jobid number to get the complete blocks from the log.

is this understandable?

Thanks and Regards,
cskumar
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need help in finding and copying list of files using bash shell script

Dear All, I have a situation where I want to copy some files of type .txt. These files are o/p from one program. Some of the files are named as fileName .txt instead of fileName.txt after fileName by mistake I have specified "space". Now I want to move these files as follows. mv fileName*... (13 Replies)
Discussion started by: linuxUser_
13 Replies

2. UNIX for Dummies Questions & Answers

finding, copying, assembling

Hi everybody, I've been running some analyses, the results of which have been stored in a sequential manner with a directory structure like step0, step1, step2, ... for iterations 0-2, for example. Each iteration contains several nested folders, with three pieces of information I need. I need to... (1 Reply)
Discussion started by: JDenton
1 Replies

3. UNIX for Dummies Questions & Answers

Finding duplicates then copying, almost there, maybe?

Hi everyone. I'm trying to help my wife with a project, she has exported 200 images from many different folders, unfortunately there was a problem with the export and I need to find the master versions so that she doesn't have to go through and select them again. I need to: For each image in... (2 Replies)
Discussion started by: Rhinoskin
2 Replies

4. SuSE

finding and removing block of identical strings

i have a problem in finding block of identical strings...i solved the problem in finding consecutive identical words and now i want to expand the code in order to find and remove consecutive identical block of strings... for example the awk code removing consecutive identical word is:... (2 Replies)
Discussion started by: cocostaec
2 Replies

5. Programming

finding and removing block of identical strings

i have a problem in finding block of identical strings...i solved the problem in finding consecutive identical words and now i want to expand the code in order to find and remove consecutive identical block of strings... for example the awk code removing consecutive identical word is:... (2 Replies)
Discussion started by: cocostaec
2 Replies

6. Shell Programming and Scripting

finding and removing block of identical strings

i have a problem in finding block of identical strings...i solved the problem in finding consecutive identical words and now i want to expand the code in order to find and remove consecutive identical block of strings... for example the awk code removing consecutive identical word is:... (2 Replies)
Discussion started by: cocostaec
2 Replies

7. Shell Programming and Scripting

Finding & Copying files

Hello :) can someone please help me with this task: I am in the shell, in folder "Main" below the folder Main are sub folders: "sourceA", "Source B", and "target" in sourceA and source B are files, and in folder "Main" is a textfile, with filenames, one filename per line. I need a... (4 Replies)
Discussion started by: Y-T
4 Replies

8. UNIX for Dummies Questions & Answers

Finding and Copying Email

I have to create a bash script that will find Feedback emails and copy them to a labFeedback folder in my mail directory. I have an idea in my head on what commands can be used for this (find obviously among them). However, I have no idea where to start. I'm not sure what info needs to be given,... (1 Reply)
Discussion started by: Joesgrrrl
1 Replies

9. Shell Programming and Scripting

script for Finding files in a folder and copying to another folder

Hi all, I have a folder '/samplefolder' in which i have some files like data0.txt, data1.txt and data2.txt. I have to search the folder for existence of the file data0.txt first and if found have to copy it to some other file; next i have to search the folder for existence of file... (5 Replies)
Discussion started by: satish2712
5 Replies

10. UNIX for Dummies Questions & Answers

finding and copying files !

Hi , I have a question relating to finding and copying files. i need to find the .pdf files from the specified directory which has subdirectories too. I only need .pdf files and not the directories and need to copy those files into my current directory. copy files from :... (5 Replies)
Discussion started by: bregoty
5 Replies
Login or Register to Ask a Question