Copy lines from a log file based on timestamp


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Copy lines from a log file based on timestamp
Prev   Next
# 1  
Old 05-22-2008
Question Copy lines from a log file based on timestamp

how to copy lines from a log file based on timestamp.

INFO [11:08:00] (RbrProcessFlifoEventSessionEJB.javaSmilierocessFlight:274) - E_20080521_110754_967: rbrAciInfoObjects listing complete!
INFO [11:08:00] (RbrPnrProcessEventSessionEJB.javaSmilierocessFlight:197) - Event Seq: 1647575217; Carrier: UA; Flt#: 0106; Origin: LAX; Dest: O
RD; SchedDepDate: 2008-05-21; Psgr Boarded: true; Pnr Loc Value: ZSQJ3I
INFO [11:08:01] (RbrPnrProcessEventSessionEJB.javaSmilierocessFlight:197) - Event Seq: 1647575217; Carrier: UA; Flt#: 0106; Origin: LAX; Dest: O
RD; SchedDepDate: 2008-05-21; Psgr Boarded: true; Pnr Loc Value: RXK8XI
INFO [11:08:01] (RbrPnrProcessEventSessionEJB.javaSmilierocessFlight:197) - Event Seq: 1647575217; Carrier: UA; Flt#: 0106; Origin: LAX; Dest: O
RD; SchedDepDate: 2008-05-21; Psgr Boarded: true; Pnr Loc Value: QGPJBI


Like this i have soo much of data. i need to grep some part of lines based on timestamp [11:08:00 to 12:20:55]

pls help me out..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Filter records from a log file based on timestamp

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

2. Shell Programming and Scripting

Check/Parse log file's lines using time difference/timestamp

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

3. Shell Programming and Scripting

extracting lines based on condition and copy to another file

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

4. Shell Programming and Scripting

copy range of lines in a file based on keywords from another file

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

5. Shell Programming and Scripting

copy files based on creation timestamp

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

6. Shell Programming and Scripting

Delete log file entries based on the Date/Timestamp within log file

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

7. Shell Programming and Scripting

Grep: Copy all lines from log file into new file

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

8. Shell Programming and Scripting

concatenate log file lines up to timestamp

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

9. Shell Programming and Scripting

copy lines from log files based on timestamp and sysdate

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

10. Shell Programming and Scripting

copy lines from log files based on timestamp and sysdate

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
Login or Register to Ask a Question
PMGETARCHIVEEND(3)					     Library Functions Manual						PMGETARCHIVEEND(3)

NAME
pmGetArchiveEnd - locate logical end of file for an archive log C SYNOPSIS
#include <pcp/pmapi.h> int pmGetArchiveEnd(struct timeval *tvp); cc ... -lpcp DESCRIPTION
Assuming the current PMAPI context is associated with an archive log, pmGetArchiveEnd will attempt to find the logical end of file (after the last complete record in the archive), and return the last recorded timestamp via tvp. This timestamp may be passed to pmSetMode(3) to reliably position the context at the last valid log record, e.g. in preparation for subsequent reading in reverse chronological order. For archive logs that are not concurrently being written, the physical end of file and the logical end of file are co-incident. However if an archive log is being written by pmlogger(1) at the same time an application is trying to read the archive, the logical end of file may be before the physical end of file due to write buffering that is not aligned with the logical record boundaries. pmGetArchiveEnd returns an error less than zero if the context is neither valid, nor associated with an archive, or the archive is seri- ously corrupted. Otherwise, the return value is 0 if there has been no change of state since the last call, or 1 if the logical end of file has advanced since the last call. In the absence of an error, the result returned via tvp is well-defined. pmGetArchiveEnd preserves the positioning state of the log file prior to this function call. PCP ENVIRONMENT
Environment variables with the prefix PCP_ are used to parameterize the file and directory names used by PCP. On each installation, the file /etc/pcp.conf contains the local values for these variables. The $PCP_CONF variable may be used to specify an alternative configura- tion file, as described in pcp.conf(5). Values for these variables may be obtained programmatically using the pmGetConfig(3) function. SEE ALSO
PMAPI(3), pmFetch(3), pmFetchArchive(3), pmGetArchiveLabel(3), pmGetConfig(3), pmSetMode(3), pcp.conf(5) and pcp.env(5). DIAGNOSTICS
PM_ERR_NOCONTEXT the current PMAPI context is either invalid, or not associated with an archive log PM_ERR_LOGREC the archive is sufficiently damaged, that not a single valid record can be found Performance Co-Pilot PCP PMGETARCHIVEEND(3)