Sponsored Content
Full Discussion: Logfile manipulation
Top Forums UNIX for Dummies Questions & Answers Logfile manipulation Post 302373628 by abilash.amara on Saturday 21st of November 2009 11:53:10 PM
Old 11-22-2009
CPU & Memory Got a solution

Code:
cat testdata | grep -o '[[:alnum:]+\.\_\-]*@[[:alnum:]+\.\_\-]*' | grep -vw '[[:alnum:]+\.\_\-]*@a-cti.com'  >to
cat testdata | grep -o '[A-Z][a-z][a-z] [0-9][0-9] [[0-9][0-9]]*:[[:digit:]]*' >time
cat testdata | grep -o '[[:alnum:]+\.\_\-]*@a-cti.com' >from

date +%s -f time > Etime

paste Etime from to -d , >Dummy
sed 's/$/,0/' Dummy > FDummy

Hey this worked ....

Hey Scrutinizer can tell me how your script runs ... step by step... I wish learn more but i dont know much... Smilie

---------- Post updated 22-11-09 at 10:23 AM ---------- Previous update was 21-11-09 at 05:37 PM ----------

I used this code

Code:
cat testdata | grep -o '[[:alnum:]+\.\_\-]*@[[:alnum:]+\.\_\-]*' | grep -vw '[[:alnum:]+\.\_\-]*@a-cti.com'  >to
cat testdata | grep -o '[A-Z][a-z][a-z] [0-9][0-9] [[0-9][0-9]]*:[[:digit:]]*' >time
cat testdata | grep -o '[[:alnum:]+\.\_\-]*@a-cti.com' >from

date +%s -f time > Etime

paste Etime from to -d , >Dummy
sed 's/$/,0/' Dummy > FDummy

So my FDummy file looks like this

Code:
1258666080,customerservice@XXX.com,abcde@yahoo.com,0
1258644660,txt@XXX.com,bdefg@jkllo.com,0

so my next challenge is to compare this file with another file called FDummy2 containing same pattern of data ie
EPOCHTIME,FORMADDRESS,TOADDRESS,0

and if any any line of data/string from FDummy is new to FDummy2 I must append/added as new line it to FDummy2. EPOCHTIME could be ignored.


Any ideas. I m stumped and dont have a clue what command to use. Also if u are gonna post a code could also explain how it works. I m like 85% newbie to linux learning as I go.Smilie

Last edited by pludi; 11-21-2009 at 10:59 AM.. Reason: removed links
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sort a logfile

Hi experts, I need help to sort a big logfile. logfile: ------- 67712 dkjd jd jj jjjj ------ kjkj jhjh kkk yggg lll hhh gffgf jj -------- i kkk kllkkl ------- Now I want every think between the "------" in one line. Normaly with paste no problem but you can see that the... (7 Replies)
Discussion started by: joerg
7 Replies

2. Shell Programming and Scripting

last month's logfile

hi friends I need a shell script which will do the following Task Enter the month : if you enter 1 then it ll show you last 1 month's (starting from today).log file in the current directry. if you enter 4 then it ll show you last 4 month's (starting from today).log file in the current... (2 Replies)
Discussion started by: deep_kol
2 Replies

3. Shell Programming and Scripting

logfile

hi iam new of the ksh script.iwant in formation of how to call in logfile in ksh scripts. if the meaning in ksh. please help me thanks naveen.g (1 Reply)
Discussion started by: naveeng.81
1 Replies

4. Shell Programming and Scripting

logfile parsing

I thought I was pretty handy with awk until I got this one. :) I'm trying to parse a log file where the events could have different delimiters (2 scripts is ok), the errors are spread over multiple lines, and I"m trying to figure out how to not read the same lines that have already been read. ... (1 Reply)
Discussion started by: linkslice
1 Replies

5. UNIX for Dummies Questions & Answers

change value of logfile

Hi, I have a log file like exyymmdd.log and i need to do is read the log file and inside the logfile if i find the word which starts with PQR002106570.book then i need to replace the value of PQRXXX.book(this is unique) with its corresponding title. A list of id(PQRXXX.book) and its title are... (5 Replies)
Discussion started by: umapearl
5 Replies

6. Shell Programming and Scripting

looking for string in logfile

I have a shell script that used to look for a particular sting in the last line of a log file. Howeve this string now has moved to the 3rd or 4th line from bottom. Can anyone point me to how i easiest chage this one to look within the last frew lines (5 or so) for the particular string rather... (6 Replies)
Discussion started by: jjlinux
6 Replies

7. UNIX for Dummies Questions & Answers

writing to a logfile

I cannot get anything to go to my log. This is what i see on my screen when i run my korn shell. cd ok, cwd=/export/home/tsp_inst/TSP pget: /nas4/edata/tsp/rawdata/test2.gz: File exists But i cant get it to write it to my log. cd /this/is/my/newdirectory lftp -e 'pget -c -n 4... (1 Reply)
Discussion started by: tyngsboro
1 Replies

8. Shell Programming and Scripting

Parsing Logfile

Hi, I need to continuously monitor a logfile to get the log information between a process start and end. the logfile look like this abcdddddddddd cjjckkkkkkkkkkkk abc : Process started aaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbb abc... (6 Replies)
Discussion started by: Byorg
6 Replies

9. Shell Programming and Scripting

Logs from logfile

Hi Team, Have to write a shell script to pick only 1 hr logs from the generated logfile and send it to other logfile. Thanks & Regards, Indu (3 Replies)
Discussion started by: indira_s
3 Replies

10. Shell Programming and Scripting

Logfile monitoring with logfile replacement

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)
Discussion started by: Warluck
3 Replies
started(7)						 Miscellaneous Information Manual						started(7)

NAME
started - event signalling that a job is running SYNOPSIS
started JOB=JOB INSTANCE=INSTANCE [ENV]... DESCRIPTION
The started event is generated by the Upstart init(8) daemon when an instance of a job has finished starting and is now running. The JOB environment variable contains the job name, and the INSTANCE environment variable contains the instance name which will be empty for sin- gle-instance jobs. init(8) emits this event as an informational signal, services and tasks started or stopped by this event will do so in parallel with other activity. It is typically combined with the stopping(7) event by services declaring a dependency. Job configuration files may use the export stanza to export environment variables from their own environment into the started event. See init(5) for more details. EXAMPLE
A service that wishes to depend on another service might use: start on started apache stop on stopping apache A task that must be run after another task or service has been started might use: start on started postgresql SEE ALSO
starting(7) stopping(7) stopped(7) init(5) Upstart 2009-07-09 started(7)
All times are GMT -4. The time now is 12:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy