get the part of log between 2 string


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting get the part of log between 2 string
# 1  
Old 04-14-2009
get the part of log between 2 string

Hi

Let's say I have a log file with this format:

Marker1
End of Marker1

....


Marker1
End of Marker1
....


Marker1
End of Marker1

how to get the last part between End of Marker1 and Marker1?

thanks
# 2  
Old 04-14-2009
i noticed you have more than 200+ posts. you should be good enough to start with something. any code you have tried?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to extract part of string from all log files.?

Hi All, Let us say we have 5 log files, extract the data from all log files and save the output in a file. home/log/first.log home/log/second.log home/log/third.log home/log/four.log home/log/five.log I want to extract the following text from the log files and save the output in a file.... (7 Replies)
Discussion started by: ROCK_PLSQL
7 Replies

2. Shell Programming and Scripting

Deleting part of a string : string manipulation

i have something like this... echo "teCertificateId" | awk -F'Id' '{ print $1 }' | awk -F'te' '{ print $2 }' Certifica the awk should remove 'te' only if it is present at the start of the string.. anywhere else it should ignore it. expected output is Certificate (7 Replies)
Discussion started by: vivek d r
7 Replies

3. Shell Programming and Scripting

Editing part of the string

Hi guys got a problem here hope u all can help me. I learn that sed can actually edit a string but you need to know the old attribute to change to new 1. Example: sed "s/$title:$author/$title:$Nauthor/g" "Harry Potter - The Half Blood Prince:J.K Rowling:40.30:10:50" Each delimiter : represent... (4 Replies)
Discussion started by: GQiang
4 Replies

4. Shell Programming and Scripting

Need to take one part from a string

I have a string something like "/opt/src/default.cfg" OR /opt/src/common/one This whole string stored in an array. The problem is this string is not constant and it will keep on changing as lot of strings are stored in the array and it will be look like :- case 1 /opt/src/default.cfg ... (8 Replies)
Discussion started by: Renjesh
8 Replies

5. Shell Programming and Scripting

Get a part of a String from a log file

Hey there, I'm searched for one day your forum for a similar solution. Didn't find one, sorry :( Now here is what I'm searching for. I have the following multiple lines from a log (Edit: log name is SystemOut.log - this is not my day. I Apologize): 000042e2 1_BLA_Yab I logging.LogInfo... (5 Replies)
Discussion started by: nobodyhere
5 Replies

6. Shell Programming and Scripting

Part of a string

Hi mates, I am doing a script in ksh. I have the following string: /opt/one/two/four/five/myFile.txt And I have a variable: echo "${variable}" -> /opt/one/two/ I would like to have just the string: four/five/myFile.txt What is the better way to do that? Thanks in... (3 Replies)
Discussion started by: gonzaloron
3 Replies

7. Shell Programming and Scripting

Getting part of a string

Hi, I have a string assinged to a varaible as below. FILE=/var/adm/message If $FILE is the value where it stores the path of message file. I would like to extract the location of the file message as below LOCATION=/var/adm FILE may have value like /var/adm/xxxx/message ... (2 Replies)
Discussion started by: raghu.amilineni
2 Replies

8. Programming

Perl get a part of a string

I need some help to divide an email address. I need to grab the left part of the @. Maybe substr? example: john.smith@domain.com.br I would need to grab just the username part... my $user = "john.smith@domain.com.br"; if($user =~ s/@/\@/){ print "EMAIL: " .$user; } (2 Replies)
Discussion started by: 4scriptmoni
2 Replies

9. Shell Programming and Scripting

how to get the last part of a string followed by a pattern

assuming "cat" is the pattern, string (regardless length) asdadfcat4 I need to get 4 for eirtrjkkkcat678- I'd get 678 (in b-shell) Thanks in advance!!! (4 Replies)
Discussion started by: bluemoon1
4 Replies

10. Shell Programming and Scripting

Finding part of a string

Hi I am very new to KSH programming and need some help with finding a string in an error log currently i am doing cat FTP_LOG.lis | grep Warning which gives me Warning: Authentication failed. Remaining authentication methods: 'publickey,pas I want to only pick up the test between the... (4 Replies)
Discussion started by: DAFNIX
4 Replies
Login or Register to Ask a Question