Scan a log file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Scan a log file
# 1  
Old 01-18-2009
Scan a log file

hi guys,

i am very new to scripting & lookin for a shell script/perl script which would scan another file with the keyword "no change" & take a count of the same. Let me know if any further details are required.
# 2  
Old 01-18-2009
That is.. easy. Just do

grep -c "no change" somefile
# 3  
Old 01-18-2009
hi Rhije,

thanks for the reply but i need a script to be written for the same. Also i need a counter for the no. of times "no change has been found" in the log file & check it against "no. of errors".
# 4  
Old 01-19-2009
could some1 please advice on the needed script
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Scan and remove if file infected using bash

The below bash runs clamav on all files in DIR and produces virus-scan.log. My question is the portion in bold is supposed to move the infected files, lines not OK, to /home/cmccabe/quarantine. Does the bash look correct? Thank you :). virus-scan.log Mon Jan 16 14:39:05 CST 2017... (5 Replies)
Discussion started by: cmccabe
5 Replies

2. Red Hat

Scan for new LUN and create a new file system

Hi Please I dont have a lot of redhat skills, but I need some help on creating a file system. I need to rescan for this new LUN, so I try to check existing LUNs: fdisk -l Disk /dev/sda: 299.4 GB, 299439751168 bytes 255 heads, 63 sectors/track, 36404 cylinders Units = cylinders of... (8 Replies)
Discussion started by: fretagi
8 Replies

3. Shell Programming and Scripting

Scan of log file in Linux for entries in last 15 minutes for matching a pattern

Is there any way I can do scan of log file in Linux, where the log file entries for last 15 minutes can be searched for a particular pattern. The log file entries are in below format. 2014-01-27T23:08:53.924-0500 LDAP authentication error 2014-01-27T23:08:53.934-0500 LDAP authentication... (4 Replies)
Discussion started by: anandrudran
4 Replies

4. Shell Programming and Scripting

Scan log file for errors

Hi everyone. I am still new to UNIX, and am having trouble figuring out how to create a script to scan a log file to look for errors based on a string. We run AIX 5.3, and would like the ability to report all the instances of WebSphere Broker Execution groups crashing. This script would... (8 Replies)
Discussion started by: jimbojames
8 Replies

5. Shell Programming and Scripting

Log File Scan

I need to read the last line of a log file and save it, sleep for X minutes and read the last line again. If the line is the same, exit 1, otherwise sleep for X minutes until the last line contains 'Status: Process completed'. Can anyone offer advice here? Thanks. (2 Replies)
Discussion started by: mode09
2 Replies

6. Shell Programming and Scripting

Shell Script to continuously scan a log file

Hello members, I have some doubts on how to write a script that can reports success / failure of a batch job ? 1. Run a batch job: 2. Wait and search for a particular string in the Log file: tail -f log01*.txt | egrep -v "^SUCCESSFUL" echo "continue with the other tasks" ... (1 Reply)
Discussion started by: novice82
1 Replies

7. Shell Programming and Scripting

File Inventory Scan

Is there such a script out there that will Analyze a folder and subfolders, getting file type utilization and file aging. A CSV file will be created with file information File,Size,Date Created,Last Modified,Last Accessed,Extension,File Type,Owner A Summary report text file will also be created... (4 Replies)
Discussion started by: seacros
4 Replies

8. Shell Programming and Scripting

How to scan a file for literal, return 0 or 1 if found?

How can i scan a file in a UNIX script and look for a particular keyword? For example if i wanted to scan the file "lpcmp165.out" and see if it contains the term "error" or "ERROR" and then return a 0 or 1 or some indicator as such? Detail example: sqlplus -s xx/yyyyyyy#@zzz <<EOF >... (11 Replies)
Discussion started by: bobk544
11 Replies

9. Shell Programming and Scripting

File Scan

Hi everyone , i m working on Sun solaris and i have a file "smsapp.cur" which has information like this paragraph given below , there are millions of such paragraphs From:923212802736 To:923222326807 logMessage: 07-04-08 17:34:29 Getting message topup from code page default in language English... (2 Replies)
Discussion started by: Dastard
2 Replies

10. UNIX for Dummies Questions & Answers

How to scan only new lines added in file?

Hi, I am planning to implement a scheduled script that will go against my log files (every hour), search for a set of key words (errors, exceptions, faults etc). The script must be intelligent enough to scan only the new lines added to the log file since it last ran. I can use grep for... (3 Replies)
Discussion started by: redlotus72
3 Replies
Login or Register to Ask a Question