Hi ,
Can someone help me,I am not well versed with scripting,it is very urjent.
Need a script in perl or shell for the following task.
The logfile contains several entries of which one particular string to be searched and that complete line has to be removed and copied to another file to maitain a record.
The path of logfile "C:\webapps\data\servername\logs\logfile_systemdat.log
Appreciate your quick responce.
Can I get the complete script from opening the file from the path to reading the log.
Cut the line from logfile and save the file.
I also want to make a note here.
There would be several entries in the logfile.
Some start with date and some start with ip and the remaining part of the line differs with the login.
The sed you mentioned will that remove the complete line.
This will create a files based on the input file names. The file without the lines you want removed will be <filename>.strip . The file with the lines removed will be <filename>.sav . <filename> is the path to the input file.
First make a file containing the awk code. I used log.awk for the example.
Change the pattern to whatever you want to use. (GuestUser?)
Then execute it using:
Where <list of files> is a bunch of files you want to process. You get a set of .sav and .strip files in the same directory as the source file.
Note: I don't believe in modifying source files when not necessary. Tools such as this should not modify input files.
If for some reason you want to do the same thing in a single line, use this format:
Can you complete the script from line one for me.I understand what you write but I wont be able to complete the script as I do not have scripting knowledge.You will be a great help to me.
1.The source logfile has to be edited and all stripped lines should be copied to one file.
2. The path of the logfiles will be C:\webapps\data\servername\logs\logfile_systemdat.log
3. The script has to run everyday,based on system date, read thru the file for each server,strip the line - copy the line to test.txt and save the log file.
Bonjour,
I've wrote a script to monitor a logfile in realtime. It is working almost perfeclty except for two things.
The script use the following technique :
tail -fn0 $logfile | \
while read line ; do
... some stuff
done
First one, I'd like a way to end the monitoring script if a... (3 Replies)
Any better way to extract the last 10 minutes from logfile?
Dec 18 09:41:18 aaa
Dec 18 09:46:29 aa
Dec 18 09:48:39 vvv
Dec 18 09:48:54 bbb
Dec 18 09:54:47 bbb
Dec 18 09:55:33 fcf
Dec 18 09:55:38 ssdf
Dec 18 09:57:58 sdsds
Dec 18 09:58:10 sdsd
Dec 18 10:00:50 sdsd
Dec 18... (5 Replies)
Hi Team,
Pls help me in fixing this problem.
I have file called ORA_FILE.log
Please find the log in that below:
************************
ORA-04061: existing state of package body "MST.ONE_PACKAGE" has been invalidated
ORA-04065: not executed, altered or dropped package body... (2 Replies)
I have a LOG file which looks like this
Import started at: Mon Jul 23 02:13:01 EDT 2012
Initialization completed in 2.146 seconds.
--------------------------------------------------------------------------------
--
Import summary for Import item: PolicyInformation... (8 Replies)
I have hundreds of files to process. In each file
I need to look for a pattern then
extract value(s) from next line and then
search for value(s) selected from point (2) in the same file at a specific position.
HEADER ELECTRON TRANSPORT 18-MAR-98 1A7V
TITLE CYTOCHROME... (7 Replies)
FOLKS ,
i have a text file that is generated automatically of an another korn shell script, i want to bring in the fifth line of the text file in to my korn shell script and look for a particular word in the line . Can you all share some thoughts on this one.
thanks...
Venu (3 Replies)
I've got a log file from automatic diagnostic runs. The log file is appended to each time an automatic log is run.
I'd like to just pull certain lines from each run in the log file, and concatenate them into 1 comma delimited line (for export into excel or an html table).
Each diagnostic run... (3 Replies)
Hi All,
I need to extract only XML details from large log file which may contain other unwanted junk details.
For example, our xml will be start as <OUTBOUND_MESSAGE .....> and ends with </OUTBOUND_MESSAGE>. I want to extract only lines between these start and end tag (Including these tags)... (5 Replies)