Sponsored Content
Full Discussion: Grep logs on the fly
Top Forums Shell Programming and Scripting Grep logs on the fly Post 302194400 by Cameron on Monday 12th of May 2008 09:32:12 PM
Old 05-12-2008
true (and how very sad, now reading my post) Smilie .... dang I need a coffee or two ...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grep yesterday logs from weblogic logs

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)
Discussion started by: harish.parker
3 Replies

2. Shell Programming and Scripting

Grep for lines in web logs

I want to find the unique url in a apache logs which got 404 error . I can do something like "cat apache.log|grep 404|awk '{print $2,$3}'|grep 404 this will give me say /foo.html 404 /foo.html 404 /foo.html 404 /bar.html 404 /cat.html 404 However my output should only find... (3 Replies)
Discussion started by: gubbu
3 Replies

3. Shell Programming and Scripting

how to grep the logs for two particular timestamp

Hi, could anyone help me out how to write a script, to grep the two timestamp from a particular file, so that it will list out all the logs between the particular timestamp I have a pattern of log: servicename operationname starttime endtime eg., servicename1 operationname1 01:11:11... (1 Reply)
Discussion started by: jacktolearn
1 Replies

4. Shell Programming and Scripting

script to grep outofmemory message in logs

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)
Discussion started by: coolguyamy
6 Replies

5. Shell Programming and Scripting

script to grep latest outofmemory string from the logs

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)
Discussion started by: coolguyamy
17 Replies

6. UNIX for Dummies Questions & Answers

Grep Logs That Are Updating

Hello all. I am new to this forum and also very new to using grep - so please excuse me if this question is not in the correct forum and/or is not pertinent to this website. I use greps like this: gunzip -c L:\System1\SailLogger_20071019* L:\System2\SailLogger_20071019*... (14 Replies)
Discussion started by: Carl2013
14 Replies

7. Shell Programming and Scripting

Script to grep logs for Errors

Hi Guys, I want to write a script which can grep the logs (server.log) from a file for Error String and output to a other file. Problems: How to know about the errors only between the current restart and not in previous as server.log has earlier restarts also? thanks for the help! Much... (5 Replies)
Discussion started by: ankur328
5 Replies

8. Shell Programming and Scripting

Grep a pattern in current date logs

Hello, I need to write one script which should search particular pattern like ABCD in log file name hello.txt only in current date logs. in current directory i have so many past date logs but grep should be applied on current date logs. on daily basis current date logs are in number 30 and... (2 Replies)
Discussion started by: ajju
2 Replies

9. Shell Programming and Scripting

Search string or words in logs without using Grep

I'm in need of some kind of script that will search for a string in each logfile in a directory but we don't want to use GREP. GREP seems to use up to much of our memory causing the server to use up a lot of swap space. Our log files are bigger than 500M on a daily basis. We lately started... (8 Replies)
Discussion started by: senormarquez
8 Replies

10. UNIX for Beginners Questions & Answers

Grep last 5 mins from logs

Hi, system date format Thu Jun 13 12:55:18 EDT 2019 My log date format 09.148.192.60 - - "GET /akamai/sureroute-test-object.html HTTP/1.1" 404 231 can someone please help me, how to get last 5mins of logs please ? I need the command Please wrap your samples/codes in CODE TAGS,... (3 Replies)
Discussion started by: scazed
3 Replies
ZoneMinder::Logger(3pm) 				User Contributed Perl Documentation				   ZoneMinder::Logger(3pm)

NAME
ZoneMinder::Logger - ZoneMinder Logger module SYNOPSIS
use ZoneMinder::Logger; use ZoneMinder::Logger qw(:all); logInit( "myproc", DEBUG ); Debug( "This is what is happening" ); Info( "Something interesting is happening" ); Warning( "Something might be going wrong." ); Error( "Something has gone wrong!!" ); Fatal( "Something has gone badly wrong, gotta stop!!" ); Panic( "Something fundamental has gone wrong, die with stack trace ); DESCRIPTION
The ZoneMinder:Logger module contains the common debug and error reporting routines used by the ZoneMinder scripts. To use debug in your scripts you need to include this module, and call logInit. Thereafter you can sprinkle Debug or Error calls etc throughout the code safe in the knowledge that they will be reported to your error log, and possibly the syslogger, in a meaningful and consistent format. Debug is discussed in terms of levels where 1 and above (currently only 1 for scripts) is considered debug, 0 is considered as informational, -1 is a warning, -2 is an error and -3 is a fatal error or panic. Where levels are mentioned below as thresholds the value given and anything with a lower level (ie. more serious) will be included. METHODS
logInit ( $id, %options ); Initialises the debug and prepares the logging for forthcoming operations. If not called explicitly it will be called by the first debug call in your script, but with default (and probably meaningless) options. The only compulsory arguments are $id which must be a string that will identify debug coming from this script in mixed logs. Other options may be provided as below, Option Default Description --------- --------- ----------- level INFO The initial debug level which defines which statements are output and which are ignored trace 0 Whether to use the Carp::shortmess format in debug statements to identify where the debug was emitted from termLevel NOLOG At what level debug is written to terminal standard error, 0 is no, 1 is yes, 2 is write only if terminal databaseLevel INFO At what level debug is written to the Log table in the database; fileLevel NOLOG At what level debug is written to a log file of the format of <id>.log in the standard log directory. syslogLevel INFO At what level debug is written to syslog. To disable any of these action entirely set to NOLOG logTerm (); Used to end the debug session and close any logs etc. Not usually necessary. $id = logId ( [$id] ); $level = logLevel ( [$level] ); $trace = logTrace ( [$trace] ); $level = logLevel ( [$level] ); $termLevel = logTermLevel ( [$termLevel] ); $databaseLevel = logDatabaseLevel ( [$databaseLevel] ); $fileLevel = logFileLevel ( [$fileLevel] ); $syslogLevel = logSyslogLevel ( [$syslogLevel] ); These methods can be used to get and set the current settings as defined in logInit. Debug( $string ); This method will output a debug message if the current debug level permits it, otherwise does nothing. This message will be tagged with the DBG string in the logs. Info( $string ); This method will output an informational message if the current debug level permits it, otherwise does nothing. This message will be tagged with the INF string in the logs. Warning( $string ); This method will output a warning message if the current debug level permits it, otherwise does nothing. This message will be tagged with the WAR string in the logs. Error( $string ); This method will output an error message if the current debug level permits it, otherwise does nothing. This message will be tagged with the ERR string in the logs. Fatal( $string ); This method will output a fatal error message and then die if the current debug level permits it, otherwise does nothing. This message will be tagged with the FAT string in the logs. Panic( $string ); This method will output a panic error message and then die with a stack trace if the current debug level permits it, otherwise does nothing. This message will be tagged with the PNC string in the logs. EXPORT None by default. The :constants tag will export the debug constants which define the various levels of debug The :variables tag will export variables containing the current debug id and level The :functions tag will export the debug functions. This or :all is what you would normally use. The :all tag will export all above symbols. SEE ALSO
Carp Sys::Syslog The ZoneMinder README file Troubleshooting section for an extended discussion on the use and configuration of syslog with ZoneMinder. http://www.zoneminder.com AUTHOR
Philip Coombes, <philip.coombes@zoneminder.com> COPYRIGHT AND LICENSE
Copyright (C) 2001-2008 Philip Coombes This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.3 or, at your option, any later version of Perl 5 you may have available. POD ERRORS
Hey! The above document had some coding errors, which are explained below: Around line 830: You forgot a '=back' before '=head2' perl v5.14.2 2011-06-28 ZoneMinder::Logger(3pm)
All times are GMT -4. The time now is 06:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy