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)
I have prepare script to grep for outofmemory messages in the logs. I need help in modifying script. I have implemented small logic. The outofmemory messages form six logs will store in variables.
var1=`grep -i outofmemory $tomcat1logs | sed -n '$p'| sed -n -e "s/.*\(outofmemory\).*/\1/p"`... (6 Replies)
I have requirement to prepare script which will grep for latest outofmemory message from the logs. I have used following command to grep the string from the logs,this script is not effective when logs are not getting updated as it will grep for old message.
f=catalina.out
var=`tail -10 $f |... (17 Replies)
Hello Team,
I need help to improve my script which is used to grep 500 error messages in the logs.
I am using following logic in the script to grep 500 error messages in the logs.
var1=`awk '$9 == "500"' access_log | tail -1`
The above logic is not useful if logs are not getting... (1 Reply)
Hi,
sorry if there already a thread about this, I did a little bit of digging but haven't found exactly what I want.
I have a java application on a glassfish server who crash from time to time :D
I need a script to allert me if there's a error like "java heappspace" or "out of memory" in the... (5 Replies)
I have directory /test/logs which has multiple logs:
audit.log
audit.log.1
audit.log.2
audit.log.3
audit.log.4
audit.log.5
audit.log is current log file and audit.log.X are archive log files. I need to search within these log files and count word "error-5" logged within last 6 months... (4 Replies)
Hi there.
Is there a way to scan a specific log file for errors that occurred in the last hour (time when script is run - 60 minutes)?
I have a script that will change to a directory where the log files are kept and will then grep the files for defined strings, but I need to make sure that... (2 Replies)
Hi there,
I have a script that I've used to find errors in my Minecraft Server logs. But I'd like to refine that script to be more useful.
Here is the script:
grep -n "SEVERE" /minecraft/server.log | awk -F":" '{print $1-2 "," $1+10 "p"}' | xargs -t -i sed -n {} /minecraft/server.log >>... (15 Replies)
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)
Discussion started by: Sanjeev G
1 Replies
LEARN ABOUT XFREE86
zgrep
ZGREP(1) General Commands Manual ZGREP(1)NAME
zgrep - search possibly compressed files for a regular expression
SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename...
DESCRIPTION
Zgrep invokes grep on compressed or gzipped files. These grep options will cause zgrep to terminate with an error code:
(-[drRzZ]|--di*|--exc*|--inc*|--rec*|--nu*). All other options specified are passed directly to grep. If no file is specified, then the
standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep.
If the GREP environment variable is set, zgrep uses it as the grep program to be invoked.
EXIT CODE
2 - An option that is not supported was specified.
AUTHOR
Charles Levert (charles@comm.polymtl.ca)
SEE ALSO grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1)ZGREP(1)