story
------------------------
The file is a.out, it consist a set of logs from user access to my system ( email system)
question
--------------------------
using shell script, how can we extract 2 sets of IP output from the a.out log by separate the IP, determine human and non-human access base on rules of multiple same IP access within maximum 4 sec time.
the rules,
1) multiple same IP access that maximum time more than 4 second time = human
2) multiple same IP access within maximum 4 second time = non-human
output
-------------------
output should be in b.out and c.out
meaning
1) b.out = IP list with rule 1
2) c.out = IP list with rule 2
So, just to be clear, what you want given the a.out in your example is for b.out to be an exact copy of a.out, and either there will be no c.out or c.out will be an empty file. Is that what you want? If that isn't what you want please explain in more detail what the output is supposed to be.
Although not entirely clear about what you want, this
will list logins with a span larger than 4 sec between earliest and latest access to b.out, and the rest to c.out. It doesn't care if there's four accesses within four sec, indicating a non-human attempt. And, it does NOT take care of periods spanning across midnight - this would open a wide field, then.
So, just to be clear, what you want given the a.out in your example is for b.out to be an exact copy of a.out, and either there will be no c.out or c.out will be an empty file. Is that what you want? If that isn't what you want please explain in more detail what the output is supposed to be.
nope, a.out is the existing file. after we ran the shell script the command will generate 2 set of files, one is b.out which contain only IP from the a.out file and the other one is c.out which also contain only IP list from a.out file.
nope, a.out is the existing file. after we ran the shell script the command will generate 2 set of files, one is b.out which contain only IP from the a.out file and the other one is c.out which also contain only IP list from a.out file.
And, (since there are only two records in your sample a.out with timestamps within 4 seconds of each other and those two records have different IPs), nothing will be written to c.out.
thanks, need to test it out first. will let you know the result soon.
---------- Post updated at 03:40 PM ---------- Previous update was at 03:01 PM ----------
seems there is no python in my unix server ---------- Post updated at 03:46 PM ---------- Previous update was at 03:40 PM ----------
Quote:
Originally Posted by RudiC
Although not entirely clear about what you want, this
will list logins with a span larger than 4 sec between earliest and latest access to b.out, and the rest to c.out. It doesn't care if there's four accesses within four sec, indicating a non-human attempt. And, it does NOT take care of periods spanning across midnight - this would open a wide field, then.
how to test this,
already put the code in code1.sh with the same directory to a.out file,
then enable all access to the code file
finally execute this with
result,
Appreciate help for the below issue.
Im using below code.....I dont want to attach the logs when I ran the perl twice...I just want to take backup with today date and generate new logs...What I need to do for the below scirpt..............
1)if logs exist it should move the logs with extention... (1 Reply)
I want to extract the logs between the current time stamp and 15 minutes before and sent an email to the people configured. I developed the below script but it's not working properly; can someone help me?? I have a log file containing this pattern:
Constructor QuartzJob
... (3 Replies)
Hi Experts,
I am new to shell.How to extract logs (Web,APP,Database) using shell in performance testing?
Need for webserver logs,app server logs and d/b logs code.
Thanks in advance
Sree (3 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)
Hi,
I urgently need some help how to extract distinct entries from a Log file.
The Log File may have same error occuring many times so how do i count the occurance of an error in file and also extract out distinct errors in a file.
Eg:-
I have a file name A.log
it contains entries as below:-... (5 Replies)
Hi,
I am trying to write a script which would go search and get the info from the logs based on yesterday timestamp and write yesterday logs in new file. The log file format is as follows:
""""""""""""""""""""""""""... (3 Replies)
Hy, I have a question
I have a directory in a unix server,
Some of my files have a diffrent access time,
from the time i accessed them last,
I think some one has copied it,it's not an important file,but none the less,it is my file,It mistakenly had a 777 permission( yes ,I know it is a noob's... (1 Reply)
Hey Guys,
i am new into shell programming and i have to do one script which have to record all the commands entered by a specific user.
Example of that, i have a system running on unix, several users are using this system, i have to create like a databse which will record every user entered that... (5 Replies)