Searching for gaps in huge (2.2G) log file?


 
Thread Tools Search this Thread
Operating Systems Linux Searching for gaps in huge (2.2G) log file?
# 1  
Old 01-04-2006
Searching for gaps in huge (2.2G) log file?

I've got a 2.2 Gig syslog file from our Cisco firewall appliance. The problem is that we've been seeing gaps in the syslog for anywhere from 10 minutes to 2 hours. Currently I've just been using 'less' and paging through the file to see if I can find any noticeable gaps. Obviously this isn't the brightest way to do this (Unless I want to finish paging through the file on 12/31/2006!). I'm wondering if there are any utilities that will find gaps with the time stamps as criteria? I've thought of maybe trying to set up some kind of loop in bash that would increment the fields in a timestamp variable and then grepping for each. Anything that doesn't show up is noted and then I can look in the file for that time reference or just before it. But there HAS to be a better way. Any thoughts?
# 2  
Old 01-05-2006
I have an idea, but I'm not much for scripting so I'll let you do that part. :-)

You could use awk to pick just the field with the timestamp in it. Then for each line subtract the timestamp from the next one. If the difference is greater than some number of minutes you choose output both lines to another file. That way you could use the (hopefully much smaller) secondary file to pinpoint exactly when the gaps occur.
# 3  
Old 01-11-2006
OK... grumble grumble...

Here's what I wound up doing:

Run a grep for the HH:MM:AM/PM string for each specific hour in 24 hours and pipe it to a file for just that hour. Then I have a better shot of trying to scroll through the logs to find any missing timestamps. Interesting to see our network usage starts going up at 9:00AM when our doors open, peaks in the afternoon when the public computers are all in use (200+ meg logs per hour between 12:00PM and 5:00PM) and then slowly drops off until we close at 9:00PM.
# 4  
Old 01-11-2006
Why not loop grepping for each minute? Pipe into "wc-l". If it's too low, print it out. That should be very easy. Don't be too surprised if it thins out during your busiest period though. syslog is a UDP service and no retransmission attempt is made.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Gaps and frequencies

I have this infile: >GHL8OVD01BNNCA Freq 10 TAGATGTGCCCGTGGGTTTCCCGTCAACACCGGATAGT-GCAGCA-TA >GHL8OVD01CMQVT Freq 1 TTGATGTCGTGGGTTTCCCGTCAACACCGGCAAATAGT-GCAGCA-TA >GHL8OVD01CMQVT Freq 1 TTGATGTGCCAGTTTCCCGTCTAGCAGCACTACCAGGACCTTCGC-TA >GHL8OVD01CMQVW Freq 1... (1 Reply)
Discussion started by: Xterra
1 Replies

2. Shell Programming and Scripting

Getting info from a huge log file

Hello everyone. I am having problem with parsing a data from the huge log file. the log file is an application log with around 5 Gb in size and it rotates every midnight. Now if the application encountered such issue, it sends an email with a specific info but without further details. So I... (13 Replies)
Discussion started by: cwiggler
13 Replies

3. Shell Programming and Scripting

searching a file with a specified text without using conventional file searching commands

without using conventional file searching commands like find etc, is it possible to locate a file if i just know that the file that i'm searching for contains a particular text like "Hello world" or something? (5 Replies)
Discussion started by: arindamlive
5 Replies

4. Shell Programming and Scripting

Sorting and moving file sequence with gaps

Hello, I have lots of sequentially numbered files which make up an image sequence. I'm trying to do two things with it: #1: Find gaps in the sequence and move each range of sequencial files into their own subfolder. #2: Designate a starting point (file) and move every 24th file into... (4 Replies)
Discussion started by: ex_H
4 Replies

5. Shell Programming and Scripting

Searching for Log / Bad file and Reading and writing to a flat file

Need to develop a unix shell script for the below requirement and I need your assistance: 1) search for file.log and file.bad file in a directory and read them 2) pull out "Load_Start_Time", "Data_File_Name", "Error_Type" from log file 4) concatinate each row from bad file as... (3 Replies)
Discussion started by: mlpathir
3 Replies

6. Shell Programming and Scripting

Searching for Gaps in Time

I am very new to shell scripting. We use C-Shell here and I know the issues that surround it. I hope a solution can be created using awk, sed, etc... instead of having to write a program. I have an input file that is sorted by date and time in ascending order ... (2 Replies)
Discussion started by: jclanc8
2 Replies

7. Shell Programming and Scripting

Searching for a string in a log file with little movement

I have a script which tails a log file and if it finds certain strings in the data tailed it sends an email, basically like this: tail -f logfile > tmp.file & sleep 10 kill $! STRING=$(grep -c "string" tmp.file) && echo $STRING | mailx -s "Warning.." admin@123.com When the string is... (10 Replies)
Discussion started by: Moxy
10 Replies

8. Shell Programming and Scripting

searching a log file and appending to a .txt file

I'm new to shell scripting and am writing a script to help me log the free memory and hd space on a server. As of now, the script just runs 'df -h' and appends the output to a file and then runs 'top' and appends the output to a log file. What I want to do, is have the script also search the... (3 Replies)
Discussion started by: enator45
3 Replies

9. Shell Programming and Scripting

help searching log file with dates

Im tyring to create a script that will show me any lines in a file with todays date and yesterdays, the date format in the file is as follows ----- amqxfdcx.c : 728 -------------------------------------------------------- 07/12/05 09:53:20 AMQ6109: An internal WebSphere MQ error has... (3 Replies)
Discussion started by: csaunders
3 Replies
Login or Register to Ask a Question