05-27-2012
Intelligent scaning of log files
Dear experts,
I have a problem and I am not clear on how to attack this. Let me define the problem as simply as possible.
1)There are several log files in a directory
2) Script should open each log file and scan for errors (grep for certain strings - say - error1, error2, error3)
3) If any errors are found - email few lines above and below of that error
4) then at the end of the log file, append some unique string, say , @EMAILED-ERRORS@
5) Next day, we will start from the unique string @EMAILED-ERRORS@ for any new errors in the log files
The problem is how to reach to the last occurrence of @EMAILED-ERRORS@ in a file? Please do not tell me to use "tac" as it is not on the AIX server.
Can this be easily done with SHELL scripts?
Any ideas will be appreciated.
Thanks in advance
-new SW
5 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
I'm writing an uninstaller for a bespoke piece of software that we deploy to our Linux terminals.
One of the packages we install is the JDK (Java Development Kit). Now over the years we have quite a number of different versions installed with different package names. In my uninstaller... (0 Replies)
Discussion started by: _Spare_Ribs_
0 Replies
2. UNIX for Dummies Questions & Answers
Hi all
I have two files which are essentially the same. However the way an exponent is written is different (i.e. in 1 file, a particular number might be written as 1.43230000E+02 whereas in another it might be 1.4323E2).
If I use SDIFF then the program will merely check the ASCII characters... (1 Reply)
Discussion started by: robbiegregg
1 Replies
3. Cybersecurity
my os is freebsd 7.1
just open sshd and hide the sshd banner
nessus still report correctly the os type
how to hide os type from scaning of nmap or nessus?
Thanx so much.
my ipfw rule:
ipfwcmd="ipfw -q add allow tcp"
localip="192.168.1.254"
$ipfwcmd from any to $localip 22 in setup... (2 Replies)
Discussion started by: overdose
2 Replies
4. Shell Programming and Scripting
Hi, I have 2 files which represent data in a Sybase table and I need to run a diff on them, and based on the first column (which is the primary key) in each file, create 3 files, one for inserts, one for deletes and one for updates
Example:
old.txt contains
server1,a,b,c
server2,d,e,f... (4 Replies)
Discussion started by: MARKPARE
4 Replies
5. Shell Programming and Scripting
Hi,
I want to split a file into multiple ones, with a new file for every line in the old file. Typically it is in this format
0.25 20 35.7143
0.5 31 55.3571
0.85 3 5.35714
1.3 2 3.57143
I can make new files by using split or other simple awk commands. But sometimes, the file is like... (7 Replies)
Discussion started by: jamie_123
7 Replies
Log(4) Kernel Interfaces Manual Log(4)
NAME
Log, .Log - Contains the uucp program log files
SYNOPSIS
/usr/spool/uucp/.Log
DESCRIPTION
The /usr/spool/uucp/.Log directories contain uucp program log files. The uucp program normally places status information about each trans-
action in the appropriate log file each time you use the networking utilities facility. All transactions of the uucico and uuxqt daemons
are logged in files named for the remote system concerned. The files are stored in a subdirectory of the /usr/spool/uucp/.Log directory
named for the daemon involved. Thus, the log files are named with a form of the following: /usr/spool/uucp/.Log/DaemonName/SystemName
The uucp and uuto commands call the uucico daemon. The uucico daemon activities for a particular remote system are logged in the System-
Name file in the /usr/spool/uucp/.Log/uucico directory on the local system.
The uux and uusend commands call the uuxqt daemon. The uuxqt daemon activities for a particular remote system are logged in the SystemName
file in the /usr/spool/uucp/.Log/uuxqt directory on the local system.
When more than one uucp process is running, however, the system cannot access the standard log file, so it places the status information in
a file with a .Log prefix that covers just the single transaction.
The uucp program can automatically append the temporary log files to a primary log file. This is called compacting the log files, and is
handled by the uudemon.cleanu command, a shell procedure, which combines the log files of the activities of the uucico and uuxqt daemons on
a system and stores them in the /usr/spool/uucp/.Old directory.
The default is for the uudemon.cleanu command to save log files that are 2 days old. This default can be changed by modifying the appro-
priate line in the shell script. If storage space is a problem on a particular system, reduce the number of days that the files are kept
in the individual log files.
The uulog command can be used to view the uucp program log files.
RELATED INFORMATION
Daemons: cron, uucico(8), uusched(8)
Commands: uucp(1), uudemon.cleanu(4), uulog(1), uusend(1), uuto(1), uux(1) delim off
Log(4)