Howto process log file from where it left


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Howto process log file from where it left
# 1  
Old 04-06-2009
Howto process log file from where it left

Hi all

I am doing some matching apache access log processing.Now i want a some way that i can start log search/process from where it left.Can any one give me ideads.
# 2  
Old 04-08-2009
Only and idea: Each time, write to a file the last linenumber processed.
Next time read that number into a variable and begin processing at that line plus 1.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Monitoring processes in parallel and process log file after process exits

I am writing a script to kick off a process to gather logs on multiple nodes in parallel using "&". These processes create individual log files. Which I would like to filter and convert in CSV format after they are complete. I am facing following issues: 1. Monitor all Processes parallelly.... (5 Replies)
Discussion started by: shunya
5 Replies

2. Shell Programming and Scripting

Ftp with bash, append file where left off

I'm working on a bash script to finish uploading a file. I need a way to get $filesize so that "restart $filesize" will work. Here is my script: ftp -n -v <<END_SCRIPT open ftp.$domain user $user@$domain $password size $file restart $filesize put $file quit END_SCRIPTWayne Sallee... (9 Replies)
Discussion started by: WayneSallee
9 Replies

3. Shell Programming and Scripting

Ksh: How to write the log file simultaneously when .sql file executes by UNIX process

Hello Team- we would like to implement an approach which has to write the log file simultaneously when .sql file is executing by Unix process. At present,it is writing the log file once the process is completed. I've tested the current process with the below approaches and none of them... (1 Reply)
Discussion started by: Hima_B
1 Replies

4. Shell Programming and Scripting

Bash Question: HowTo Exit Script with User Input While Process is Running Mid-Loop?

Hi, I have written a script that allows me to repetitively play a music file $N times, which is specified through user input. However, if I want to exit the script before it has finished looping $N times, if I use CTRL+c, I have to CTRL+c however many times are left in order to complete the loop.... (9 Replies)
Discussion started by: hilltop_yodeler
9 Replies

5. Shell Programming and Scripting

File count from where it left??

i have this code num=1 dat10=`date "+%m/%d/%Y" -d "+10 days"` dat=`date "+%m/%d/%Y"` set -x grep "text=.&" /root/Softwares/apache-tomcat-5.5.30/logs/catalina.out|awk -F"from=" '{print $2}'|awk -F"opid" '{print $1}'|sort|uniq > pnos while read line do psql -U poss -d emsver -c "insert into... (3 Replies)
Discussion started by: nikhil jain
3 Replies

6. Shell Programming and Scripting

Left Align of Text File

Input: hiddenhausen 99.60 y 1.05 2.50 -550 -110 1:25:200 herbstein 99.021 n 1.05 2.50 -550 -110 1:25:200 bangalore 98.82 y 1.05 2.50 -550 -110 1:25:200 golm 98.8 y 1.05 2.50 -550 -110 1:25:200 para 98.82 n 1.05 2.50 -550 -110 1:25:200 bogen 98.61 n 1.05 2.50 -550 -110 1:25:200 saintandre... (5 Replies)
Discussion started by: asavaliya
5 Replies

7. Shell Programming and Scripting

Multiple process write to same log file at the same time

If we have 3 process to write to same log file at the same time like below. will it cause the data outdated because the multiple process writing same time? It this a safe way to keep the log for multiple process? p1 >> test.log &; p2 >> test.log &; p3 >> test.log & Thanks, (5 Replies)
Discussion started by: casttree
5 Replies

8. Shell Programming and Scripting

Howto create a file

Hi folks, How do we create a file using shell script? i mean to say that do we use is it a good approch to do echo "abc" >file echo "xxxx" >>file or is there any better method? Thanks, Amit (5 Replies)
Discussion started by: amit4g
5 Replies

9. Shell Programming and Scripting

Which Process is writing this Log file!!

Hello , Well I have some /tmp files which are growing very quickly..Can anyone suggest me a way to find which process is logging into this file :confused: ? Thanks very much in Advance!! Mohammed (2 Replies)
Discussion started by: Mohammed
2 Replies

10. UNIX for Dummies Questions & Answers

Howto Attach File with Sendmail

Hi, How can I attach a file using sendmail? I tried /A option like this: $ /usr/bin/sendmail toaddress@gmail.com /A afile.txt but doesn't seem to work. - Monkfan (2 Replies)
Discussion started by: monkfan
2 Replies
Login or Register to Ask a Question