05-22-2008
OK, do a 'grep "time stamp here" file-name > filteredLogs.tmp; cp filteredLogs.tmp whateverNameYouLike.log and voila
The grep for particular pattern will output the lines matching the criteria, and then you redirect the result to a temp file, then you copy this file with a preferred name, HTH.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am sorry to repost this question. it was not clear, and I had the meeting and didn't response the question on time. I do really need help and appreciate your help very much.
I'm looking for a simple shell script that will read lots of audit log file (*.aud) in a log fold every 10 minutes,... (1 Reply)
Discussion started by: percvs88
1 Replies
2. Shell Programming and Scripting
I'm looking for a command or simple script that will read lots of audit log file (*.aud) in log fold every 10 minutes, and will output to one file based on sysdate - 10 minutes. assume the script is run at 11:12:20, and it
should grep the line from Wed Jun 17 11:02:43 2009 to end of file. after... (4 Replies)
Discussion started by: percvs88
4 Replies
3. Shell Programming and Scripting
Hi,
Using sed awk or perl I am trying to do something similar to
https://www.unix.com/shell-programming-scripting/105887-sed-awk-concatenate-lines-until-blank-line-2.html
but my requirement is slightly different. What I am trying to accomplish is to reformat a logfile such that all lines... (4 Replies)
Discussion started by: AlanC
4 Replies
4. Shell Programming and Scripting
Hello everyone. I have a log file that contains multiple domains:
www.thisdomain.com
agent.thisdomain.com
that.thisdomain.com
I need to copy all of the lines that contain "www.thisdomain.com" from the log and output them into a new file. I've tried everything with little luck. Please help... (3 Replies)
Discussion started by: aberli
3 Replies
5. Shell Programming and Scripting
If a log file is in the following format
28-Jul-10 ::: Log message
28-Jul-10 ::: Log message
29-Jul-10 ::: Log message
30-Jul-10 ::: Log message
31-Jul-10 ::: Log message
31-Jul-10 ::: Log message
1-Aug-10 ::: Log message
1-Aug-10 ::: Log message
2-Aug-10 ::: Log message
2-Aug-10 :::... (3 Replies)
Discussion started by: vikram3.r
3 Replies
6. Shell Programming and Scripting
Dear friends..
I have the below listing of files under a directory in unix
-rw-r--r-- 1 abc abc 263349631 Jun 1 11:18 CDLD_20110603032055.xml
-rw-r--r-- 1 abc abc 267918241 Jun 1 11:21 CDLD_20110603032104.xml
-rw-r--r-- 1 abc abc 257672513 Jun 3 10:41... (5 Replies)
Discussion started by: sureshg_sampat
5 Replies
7. Shell Programming and Scripting
Hi Guys,
I have the following problem. I have original file (org.txt) that looks like this
module v_1(.....)
//arbitrary number of text lines
endmodule
module v_2(....)
//arbitrary number of text lines
endmodule
module v_3(...)
//arbitrary number of text lines
endmodule
module... (6 Replies)
Discussion started by: kaaliakahn
6 Replies
8. Shell Programming and Scripting
hi
i have an input file that contains some thing like this
aaa acc aa abc1 1232 aaa abc2....
poo awq aa abc1 aaa aaa abc2
bbb bcc bb abc1 3214 bbb abc3....
bab bbc bz abc1 3214 bbb abc3....
vvv ssa as abc1 o09 aaa abc4....
azx aaq aa abc1 900 aqq abc19....
aaa aa aaaa abc1 899 aa... (8 Replies)
Discussion started by: anurupa777
8 Replies
9. Shell Programming and Scripting
I was looking at this script which outputs the two lines which differs less than one sec.
#!/usr/bin/perl -w
use strict;
use warnings;
use Time::Local;
use constant SEC_MILIC => 1000;
my $file='infile';
## Open for reading argument file.
open my $fh, "<", $file or die "Cannot... (1 Reply)
Discussion started by: cele_82
1 Replies
10. UNIX for Beginners Questions & Answers
Dear Experts,
I have a log file that contains a timestamp, I would like to filter record from that file based on timestamp. For example refer below file -
cat sample.txt
Jan 19 20:51:48 mukul-Vostro-14-3468 systemd: pam_unix(systemd-user:session): session opened for user root by (uid=0)... (6 Replies)
Discussion started by: mukulverma2408
6 Replies
LEARN ABOUT DEBIAN
courier::filter::logger::iohandle
Courier::Filter::Logger::IOHandle(3pm) User Contributed Perl Documentation Courier::Filter::Logger::IOHandle(3pm)
NAME
Courier::Filter::Logger::IOHandle - I/O handle logger for the Courier::Filter framework
SYNOPSIS
use Courier::Filter::Logger::IOHandle;
my $logger = Courier::Filter::Logger::IOHandle->new(
handle => $handle
);
# For use in an individual filter module:
my $module = Courier::Filter::Module::My->new(
...
logger => $logger,
...
);
# For use as a global Courier::Filter logger object:
my $filter = Courier::Filter->new(
...
logger => $logger,
...
);
DESCRIPTION
This class is an I/O handle logger class for use with Courier::Filter and its filter modules.
Constructor
The following constructor is provided:
new(%options): returns Courier::Filter::Logger::IOHandle
Creates a new logger that logs messages as lines to an I/O handle.
%options is a list of key/value pairs representing any of the following options:
handle
Required. The I/O handle or IO::Handle object to which log messages should be written.
timestamp
A boolean value controlling whether every log message line should be prefixed with a timestamp (in local time, in ISO format).
Defaults to false.
Instance methods
The following instance methods are provided:
log_error($text): throws Perl exceptions
Logs the error message given as $text (a string which may contain newlines). Prefixes each line with a timestamp if the "timestamp"
option has been set through the constructor.
log_rejected_message($message, $reason): throws Perl exceptions
Logs the Courier::Message given as $message as having been rejected due to $reason (a string which may contain newlines).
SEE ALSO
Courier::Filter::Logger, Courier::Filter::Overview.
For AVAILABILITY, SUPPORT, and LICENSE information, see Courier::Filter::Overview.
AUTHOR
Julian Mehnle <julian@mehnle.net>
perl v5.14.2 2011-12-27 Courier::Filter::Logger::IOHandle(3pm)