Sponsored Content
Top Forums Shell Programming and Scripting How to get the Logs between two Time Stamps? Post 302931225 by amitgpta90 on Monday 12th of January 2015 02:48:43 AM
Old 01-12-2015
Hi,

I need to input 2 dates & time and get the log based on the time, i am able to get the logs for 24 hours using "mtime-1" for the file say xLOG in a directory.

I just need a code to get between two time periods


The sample Logs are stored in this time format:-
Timestamp: Mon Jan 12 01:59:53 EST 2015
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

List files with date and time stamps only

Hi there, I'm using terminal on mac and using the ls -l command to list all the files in a directory. However, I only want to display the date and time stamp of each file rather than permissions, owner, group etc... Is this possible? Many thanks in advance Dave (2 Replies)
Discussion started by: davewg
2 Replies

2. UNIX for Dummies Questions & Answers

Problem with subtracting time stamps in excel..

Hi All, I need an unix script/command to delete the milliseconds from the time stamps so that it becomes compatible with Excel sheet while displaying finally. I have the following data in 2 columns which was obtained with some unix script(awk based) on some log files. Finally i want to... (1 Reply)
Discussion started by: ks_reddy
1 Replies

3. UNIX for Dummies Questions & Answers

comparing time stamps

Hello All, I'm generating timestamps (file creation timestamps) for all the files in a directory. I need to compare all the timestamps. for example if i have 4 files and their timestamps are 20091125114556, 20091125114556,20091125114556,20091125114556 respectively. I need to differentiate... (1 Reply)
Discussion started by: RSC1985
1 Replies

4. Shell Programming and Scripting

comparing time stamps

Hello All, I'm generating timestamps (file creation timestamps) for all the files in a directory. I need to compare all the timestamps. for example if i have 4 files and their timestamps are 20091125114556, 20091125114556,20091125114556,20091125114556 respectively. I need to differentiate... (9 Replies)
Discussion started by: RSC1985
9 Replies

5. Shell Programming and Scripting

Perl - Search file between two time stamps

Hi, I am on a windows system that receives files from differnet host, I have to find the count of files that we receive between specific time. The code below is what i use to count the number of file, how do i change this to count files between specfic time opendir ( DIR, $dir ) || die... (1 Reply)
Discussion started by: amit1_x
1 Replies

6. Shell Programming and Scripting

Time difference between two time stamps

Hi Friends, I have 2 varaibles which contain START=`date '+ %m/%d/%y %H:%M:%S'` END=`date '+ %m/%d/%y %H:%M:%S'` i want the time difference between the two variables in Seconds. Plz help. (2 Replies)
Discussion started by: i150371485
2 Replies

7. Shell Programming and Scripting

date time stamps in bash

I'm looking for a way to have the "date" command output the date in a specific format. I'm not familiar with the different ways to use the date command at all. i read up on it, but i dont get how to manipulate it. i know that i can get the date format to give me a format like: 2012-10-13... (6 Replies)
Discussion started by: SkySmart
6 Replies

8. Shell Programming and Scripting

Increment time stamps.

Hi Gents. Please can you help me to solve a problem. I have a long list of files, which I need to change the time stamp. -r--r--r-- 1 geo2 geovect 47096216 Feb 8 10:40 00000009.segd -r--r--r-- 1 geo2 geovect 47096216 Feb 8 10:40 00000010.segd -r--r--r-- 1 geo2 geovect 47096216 Feb ... (11 Replies)
Discussion started by: jiam912
11 Replies

9. Shell Programming and Scripting

Collecting logs between two time stamps

Hi, please help me to collect the entire log files between two time stamp. for example, I am looking script to collect the entire log between "2015-03-27 15:59" to "2015-03-27 16:15" in the below sample log file. OS : RHEL 6.3 Date/Time : 24 hours format, the time is printing each log... (12 Replies)
Discussion started by: jerryknj
12 Replies

10. Windows & DOS: Issues & Discussions

Cygwin_openssh time stamps

I've installed cygwin_openssh on Windows 2012 R2 and it's working great. My issue is when a file is uploaded say from a different timezone, when it is uploaded, it doesnt pick up the sftp servers time.. Is there a way to fix that? i.e. When someone in PST uploads a file to this server in EST,... (0 Replies)
Discussion started by: MikeAdkins
0 Replies
Easy(3pm)						User Contributed Perl Documentation						 Easy(3pm)

NAME
MooseX::Log::Log4perl::Easy - A role for easy usage of logging in your Moose based modules based on MooseX::Log::Log4perl SYNOPSIS
package MyApp; use Moose; use Log::Log4perl qw(:easy); with 'MooseX::Log::Log4perl::Easy'; BEGIN { Log::Log4perl->easy_init(); } sub foo { my ($self) = @_; $self->log_debug("started bar"); ### logs with default class catergory "MyApp" $self->log_info('bar'); ### logs an info message $self->log('AlsoPossible')->fatal("croak"); ### log } DESCRIPTION
The Easy logging role based on the MooseX::Log::Log4perl logging role for Moose directly adds the logmethods for all available levels to your class instance. Hence it is possible to use $self->log_info("blabla"); without having to access a separate log attribute as in MooseX::Log::Log4perl; In case your app grows and you need more of the super-cow powers of Log4perl or simply don't want the additional methods to clutter up your class you can simply replace all code "$self->log_LEVEL" with "$self->log->LEVEL". You can use the following regex substitution to accomplish that: s/log(_(trace|debug|info|warn|error|fatal))/log->$2/g ACCESSORS
logger See MooseX::Log::Log4perl log See MooseX::Log::Log4perl log_fatal ($msg) Logs a fatal message $msg using the logger attribute. Same as calling $self->logger->fatal($msg) log_error ($msg) Logs an error message using the logger attribute. Same as calling $self->logger->error($msg) log_warn ($msg) Logs a warn message using the logger attribute. Same as calling $self->logger->warn($msg) log_info ($msg) Logs an info message using the logger attribute. Same as calling $self->logger->info($msg) log_debug ($msg) Logs a debug message using the logger attribute. Same as calling $self->logger->debug($msg) log_trace ($msg) Logs a trace message using the logger attribute. Same as calling $self->logger->trace($msg) SEE ALSO
MooseX::Log::Log4perl, Log::Log4perl, Moose BUGS AND LIMITATIONS
Please report any bugs or feature requests to "bug-moosex-log4perl@rt.cpan.org", or through the web interface at <http://rt.cpan.org>. Or come bother us in "#moose" on "irc.perl.org". AUTHOR
Roland Lammel "<lammel@cpan.org>" Inspired by suggestions by Michael Schilli "<m@perlmeister.com>" Contributions from Tim Bunce "<TIMB@cpan.org>" LICENSE AND COPYRIGHT
Copyright (c) 2008-2012, Roland Lammel "<lammel@cpan.org>", http://www.quikit.at This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic. perl v5.14.2 2012-06-27 Easy(3pm)
All times are GMT -4. The time now is 08:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy