07-03-2012
Help needed to extract distinct logs from a Log File
Hi,
I urgently need some help how to extract distinct entries from a Log file.
The Log File may have same error occuring many times so how do i count the occurance of an error in file and also extract out distinct errors in a file.
Eg:-
I have a file name A.log
it contains entries as below:-
Error 1
Error 2
Error 1
Error 1
Error 2
I want distinct errors and their occurances.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I would like to write a bash script that would monitor a log file for a certain number of logs, let's say 500 logs and when it reaches that number to write the last log to another file. For example, I want to watch the /var/adm/messages and everytime, there is 500 new logs that are... (1 Reply)
Discussion started by: Pouchie1
1 Replies
2. Shell Programming and Scripting
HI All,
I have a log file where the logs will be in the format as given below:
2011-05-25 02:32:51 INFO PROCESS STARTING
2011-05-25 02:32:52 INFO PROCESS STARTED
.
.
.
I want to retrieve only the logs which are less than 5 mins older than current time using grep... (3 Replies)
Discussion started by: rvhg16
3 Replies
3. Shell Programming and Scripting
Hi ,
I have a Data cleansing process which creates different log file for each step , when the process runs it creates following log files in below order:
p1_tranfrmr_log.txt
p1_tranfrmr_stats.txt
p2_globrtr_log.txt
p2_globrtr_stats.txt
p3_cusparse_log.txt
p3_cusparse_stats.txt
'
'... (8 Replies)
Discussion started by: sonu_pal
8 Replies
4. Shell Programming and Scripting
I am executing a stored procedure through shell script. In the procedure, i have dbms_output.put_line to log the comments. This is working fine and but logs are available only after the execution of the pl/sql procedure's completion.
I want to print the log comments while executing the procedure... (2 Replies)
Discussion started by: vel4ever
2 Replies
5. Shell Programming and Scripting
Hello,
I need a utility script or command that will extract the following lines from a file based on a 'word' contain in a line. For example my file contains lot of lines.
So if i pass 1800182 to the script/command it should return everything between 1st RequestNetRates tag before it and 1st... (4 Replies)
Discussion started by: jakSun8
4 Replies
6. Shell Programming and Scripting
story
------------------------
The file is a.out, it consist a set of logs from user access to my system ( email system)
question
--------------------------
using shell script, how can we extract 2 sets of IP output from the a.out log by separate the IP, determine human and non-human... (21 Replies)
Discussion started by: Mr_47
21 Replies
7. Shell Programming and Scripting
HI,
I want to search for a logs which are trace between specific date and time from logs file.
My logs are generated like this :-
Tue Jun 18 05:00:02 EEST 2013 | file_check.sh| Message:script has files to process.
Thu Jun 20 05:00:02 EEST 2013 | file_check.sh| Message:script has files to... (5 Replies)
Discussion started by: ketanraut
5 Replies
8. Shell Programming and Scripting
I have a log file with the below contents :
log_file_updated.txt :
Jul 5 03:33:06 rsyslogd: was
Jul 5 03:33:09 adcsdb1 rhsmd: This system is registered.
Sep 2 02:45:48 adcsdb1 UDSAgent: 2015-07-05 04:24:48.959 INFO Worker_Thread_4032813936 Accepted connection from host <unknown>... (3 Replies)
Discussion started by: rahul2662
3 Replies
9. Shell Programming and Scripting
I want to extract the logs between the current time stamp and 15 minutes before and sent an email to the people configured. I developed the below script but it's not working properly; can someone help me?? I have a log file containing this pattern:
Constructor QuartzJob
... (3 Replies)
Discussion started by: puneetkhullar
3 Replies
10. Shell Programming and Scripting
I have been searching and reading about syslog. I would like to know how to Transfer the logs being thrown into /var/log/messages into another file example /var/log/volumelog.
tail -f /var/log/messages
dblogger: msg_to_dbrow: no logtype using missing
dblogger: msg_to_dbrow_str: val ==... (2 Replies)
Discussion started by: kenshinhimura
2 Replies
LEARN ABOUT DEBIAN
log::agent::channel
Agent::Channel(3pm) User Contributed Perl Documentation Agent::Channel(3pm)
NAME
Log::Agent::Channel - ancestor class for all Log::Agent channels
SYNOPSIS
@Log::Agent::Channel::XXX::ISA = qw(Log::Agent::Channel);
DESCRIPTION
The "Log::Agent::Channel" class is the root class from which all "Log::Agent" channels inherit. It is a deferred class, meaning that it
cannot be instantiated directly. All the deferred routines need to be implemented by its heirs to form a valid driver.
Internally, the various "Log::Agent::Driver" objects create "Log::Agent::Channel" instances for each logging channel defined at driver
creation time. The channels are therefore architecturally hidden within "Log::Agent", since this module only provides redefined mappings
for the various logxxx() routines (logerr(), logwarn(), logdie(), etc...).
However, this does not mean that channel classes cannot be used externally: the "Log::Agent::Logger" extension makes "Log::Agent::Channel"
objects architecturally visible, thereby offering an application-level logging API that can be redirected to various places transparently
for the application.
CHANNEL LIST
The following channels are currently made available by "Log::Agent". More channels can be defined by the "Log::Agent::Logger" extension:
Log::Agent::Channel::File
This channel writes logs to files, defined by their path or via a magical opening sequence such as "|cmd". See
Log::Agent::Channel::File.
Log::Agent::Channel::Handle
This channel writes logs to an already opened descriptor, as specified by its file handle: an IO::Handle object, or a GLOB reference
such as *FILE. See Log::Agent::Channel::Handle.
Log::Agent::Channel::Syslog
This channel redirects logs to the syslogd(8) daemon, which will then handle the dispatching to various logfiles, based on its own
configuration. See Log::Agent::Channel::Syslog.
INTERFACE
You need not read this section if you're only using "Log::Agent". However, if you wish to implement another channel, then this section
might be of interest.
The following routines are deferred and therefore need to be defined by the heir:
write($priority, $logstring)
Emit the log entry held in $logstring, at priority $priority. A trailing "
" is added to the $logstring, if needed (i.e. if the
physical entity does not do it already, like syslog does).
The $priority argument must be a valid syslog priority, i.e. one of the following strings: "emerg", "alert", "crit", "err", "warning",
"notice", "info", "debug".
The $logstring may not really be a plain string. It can actually be a Log::Agent::Message object with an overloaded stringification
routine, so the illusion should be complete.
close
Close the channel.
make
This is the creation routine. Its signature varies for each channel, naturally.
AUTHOR
Raphael Manfredi <Raphael_Manfredi@pobox.com>
SEE ALSO
Log::Agent::Channel::File(3), Log::Agent::Channel::Handle(3), Log::Agent::Channel::Syslog(3), Log::Agent::Logger(3).
perl v5.10.0 2002-03-09 Agent::Channel(3pm)