Sponsored Content
Top Forums Shell Programming and Scripting Extract the last 10 minutes from logfile Post 302881129 by DGPickett on Thursday 26th of December 2013 05:30:13 PM
Old 12-26-2013
Real time, or relative to the final post? I assume all important timestamps are formatted identically.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Convert minutes to hours, minutes, seconds

How would you convert lets say a 1000 minutes to hours, minutes, seconds (1 Reply)
Discussion started by: Vozx
1 Replies

2. Shell Programming and Scripting

Need to extract specific pattern from logfile

Log File: Attempting to contact (DESCRIPTION=(SOURCE_ROUTE=OFF)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=hostname1.com)(PORT=1521)))(CONNECT_DATA=(SID=database1)(SRVR=DEDICATED))) Attempting to contact... (2 Replies)
Discussion started by: techychap
2 Replies

3. Shell Programming and Scripting

Script to extract line from logfile

Hi , Can someone help me,I am not well versed with scripting,it is very urjent. Need a script in perl or shell for the following task. The logfile contains several entries of which one particular string to be searched and that complete line has to be removed and copied to another file to... (25 Replies)
Discussion started by: garryt21@rediff
25 Replies

4. Shell Programming and Scripting

Perl - Extract 12 hour time, convert to 24 and subtract 15 minutes?

OK, I am by no means a programmer... I have been given the task to do some automation scripts. I have got most of it working from snippets I have found on the Web. One requirement has me stumped. The initial timing file created by the user is a comma delimited in the following format.... (4 Replies)
Discussion started by: autotuner
4 Replies

5. Shell Programming and Scripting

Extract three substrings from a logfile

I have a log file like below. 66.249.73.11 - - "UCiZ7QocVqYAABgwfP8AAHAA" "US" "Mediapartners-Google" "-" www.mahashwetha.com.sg "GET... (2 Replies)
Discussion started by: Tuxidow
2 Replies

6. Shell Programming and Scripting

Checking if logfile updates after 5 minutes

I would like to create a script that will send an email to me if it does not update after 5 minutes. I have created this script but it doesn't work. #!/bin/ksh # Variable Declaration log=/opt/app/netcool/omnibus/log.txt servertime=`date | awk '{print $2,$3,$4 }' | cut -d ":" -f1,2`... (5 Replies)
Discussion started by: Dan Llave
5 Replies

7. Shell Programming and Scripting

Logfile monitoring with logfile replacement

Bonjour, I've wrote a script to monitor a logfile in realtime. It is working almost perfeclty except for two things. The script use the following technique : tail -fn0 $logfile | \ while read line ; do ... some stuff done First one, I'd like a way to end the monitoring script if a... (3 Replies)
Discussion started by: Warluck
3 Replies

8. Shell Programming and Scripting

How to extract logs between the current time and the last 15 minutes ?

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

9. UNIX for Beginners Questions & Answers

How to convert days hours minutes seconds to minutes?

Hi, please help with below time conversion to minutes. one column values: 2 minutes 16 seconds 420 msec 43 seconds 750 msec 0 days 3 hours 29 minutes 58 seconds 480 msec 11 seconds 150 msec I need output in minutes(total elapsed time in minutes) (2 Replies)
Discussion started by: ramu.badugula
2 Replies

10. Shell Programming and Scripting

Grep a log file for the last 5 minutes of contents every 5 minutes

Hi all, System Ubuntu 16.04.3 LTS i have the following log INFO 2019-02-07 15:13:31,099 module.py:700] default: "POST /join/8550614e-3e94-4fa5-9ab2-135eefa69c1b HTTP/1.0" 500 2042 INFO 2019-02-07 15:13:31,569 module.py:700] default: "POST /join/6cb9c452-dcb1-45f3-bcca-e33f5d450105... (15 Replies)
Discussion started by: charli1
15 Replies
pcg(4rheolef)							    rheolef-6.1 						     pcg(4rheolef)

NAME
pcg -- conjugate gradient algorithm. SYNOPSIS
template <class Matrix, class Vector, class Preconditioner, class Real> int pcg (const Matrix &A, Vector &x, const Vector &b, const Preconditioner &M, int &max_iter, Real &tol, odiststream *p_derr=0); EXAMPLE
The simplest call to 'pcg' has the folling form: size_t max_iter = 100; double tol = 1e-7; int status = pcg(a, x, b, EYE, max_iter, tol, &derr); DESCRIPTION
pcg solves the symmetric positive definite linear system Ax=b using the Conjugate Gradient method. The return value indicates convergence within max_iter (input) iterations(0), or no convergence within max_iter iterations(1). Upon suc- cessful return, output arguments have the following values: x approximate solution to Ax = b max_iter the number of iterations performed before the tolerance was reached tol the residual after the final iteration NOTE
pcg is an iterative template routine. pcg follows the algorithm described on p. 15 in @quotation Templates for the Solution of Linear Systems: Building Blocks for Iterative Methods, 2nd Edition, R. Barrett, M. Berry, T. F. Chan, J. Demmel, J. Donato, J. Dongarra, V. Eijkhout, R. Pozo, C. Romine, H. Van der Vorst, SIAM, 1994, ftp.netlib.org/templates/tem- plates.ps. @end quotation The present implementation is inspired from IML++ 1.2 iterative method library, http://math.nist.gov/iml++. IMPLEMENTATION
template <class Matrix, class Vector, class Vector2, class Preconditioner, class Real, class Size> int pcg(const Matrix &A, Vector &x, const Vector2 &Mb, const Preconditioner &M, Size &max_iter, Real &tol, odiststream *p_derr = 0, std::string label = "cg") { Vector b = M.solve(Mb); Real norm2_b = dot(Mb,b); if (norm2_b == Real(0)) norm2_b = 1; Vector Mr = Mb - A*x; Real norm2_r = 0; if (p_derr) (*p_derr) << "[" << label << "] #iteration residue" << std::endl; Vector p; for (Size n = 0; n <= max_iter; n++) { Vector r = M.solve(Mr); Real prev_norm2_r = norm2_r; norm2_r = dot(Mr, r); if (p_derr) (*p_derr) << "[" << label << "] " << n << " " << ::sqrt(norm2_r/norm2_b) << std::endl; if (norm2_r <= sqr(tol)*norm2_b) { tol = ::sqrt(norm2_r/norm2_b); max_iter = n; return 0; } if (n == 0) { p = r; } else { Real beta = norm2_r/prev_norm2_r; p = r + beta*p; } Vector Mq = A*p; Real alpha = norm2_r/dot(Mq, p); x += alpha*p; Mr -= alpha*Mq; } tol = ::sqrt(norm2_r/norm2_b); return 1; } rheolef-6.1 rheolef-6.1 pcg(4rheolef)
All times are GMT -4. The time now is 03:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy