Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Viewing a specific timeframe of a log file Post 302996432 by RudiC on Wednesday 26th of April 2017 07:13:18 AM
Old 04-26-2017
Well, 2017 in the regex doesn't really match 17 in the file. And, 12:00 is the closing regex for the range, so matching is stopped there before it even starts.

Try, with an adequate file (i.e. entries BEFORE 12:00h on that date)
Code:
sed -n '\^4/26/17 08:^, \^4/26/17 12:^p'  file

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

viewing specific lines

hi, is there any command on viewing specific line number of a file? thanks (3 Replies)
Discussion started by: dakid
3 Replies

2. Shell Programming and Scripting

How to read a specific value from a Log file?

Hi, I have a .log file in which it has many values. But i need some specific values. How it can be done using Shell Script. Please explain in detail. Thankx in advance. Sathish D V. (8 Replies)
Discussion started by: cooolthud
8 Replies

3. Shell Programming and Scripting

print contents of any file within some timeframe

Hi, Is there anyway to print contents of any file ( say log files that grow automatically) within some timeframe ( comparing with current time), say print contents of the added in: 1) last 2 hr 2) last 45 min 3) last 3 hrs 47 min (3 Replies)
Discussion started by: fed.linuxgossip
3 Replies

4. Shell Programming and Scripting

Date within a timeframe 2 days ago

How could I using the following example, change it to show 2 days ago within the same time frame 0600 AM to 0600 AM let foo=`date "+(1%H-106)*60+1%M-100"` bar=foo+1440 find . -mmin +$foo -mmin -$bar | tr -s '/','-' '^' | cut -f2,3 -d"^" | tr -s '^' ' ' | Please use code tags (7 Replies)
Discussion started by: freddie999
7 Replies

5. Solaris

Logging out idle users after a certain timeframe

We recently underwent a security audit and have a new requirement to not allow users to stay logged on overnight. In order to place this policy into effect i need a way to check for idle users and log them off. Is there any good way to enforce this policy in Solaris 10 and make it work in such a... (11 Replies)
Discussion started by: goose25
11 Replies

6. Shell Programming and Scripting

Help with viewing the Log files

I have a file name as logfiles_tar.tgz. How can I view the contents of the log files present in logfiles_tar.tgz ? Any help would be really appreciated. Thanks (3 Replies)
Discussion started by: bobby1015
3 Replies

7. Shell Programming and Scripting

Taking a specific value from a log file

Dear community, I've a file contaning some logs like: 185413.854: 185456.748: 185457.631: 185467.213: 185468.913: 185472.378: 185479.944: 185482.828: 185486.855: 185490.946: 185497.580: 185501.771: 185501.787: 185511.343: 185513.458: 3101902K(4089472K), 0.0117240 secs]... (6 Replies)
Discussion started by: Lord Spectre
6 Replies

8. UNIX for Dummies Questions & Answers

Search for a specific String in a log file for a specific date range

Hi, I have log file which rolls out every second which is as this. HttpGenRequest - -<!--OXi dbPublish--> <created="2014-03-24 23:45:37" lastMsgId="" requestTime="0.0333"> <response request="getOutcomeDetails" code="114" message="Request found no matching data" debug="" provider="undefined"/>... (3 Replies)
Discussion started by: karthikprakash
3 Replies

9. Solaris

Command to grep the service with in a timeframe

Guys, I am trying to use this command to find out the occurrence of the service "Loadservice" from the log file "log.06102010.svr1" in between the time frame 02:00:00 to 03:00:00 on the day 06-10-2010. sed -n '/2010-06-10 02:00:00/,/2010-06-10 03:00:00/p' | fgrep "Loadservice"... (14 Replies)
Discussion started by: kriss.gv
14 Replies

10. Shell Programming and Scripting

Grep a log file starting from a specific time to the end of file

I have a log file which have a date and time at the start of every line. I need to search the log file starting from a specific time to the end of file. For example: Starting point: July 29 2018 21:00:00 End point : end of file My concern is what if the pattern of `July 29 2018 21:00:00`... (3 Replies)
Discussion started by: erin00
3 Replies
VARNISHHIST(1)															    VARNISHHIST(1)

NAME
varnishhist - Varnish request histogram SYNOPSIS
varnishhist [-b] [-C] [-c] [-d] [-I regex] [-i tag] [-m tag:regex ...] [-n varnish_name] [-r file] [-V] [-w delay] [-X regex] [-x tag] DESCRIPTION
The varnishhist utility reads varnishd(1) shared memory logs and presents a continuously updated histogram show- ing the distribution of the last N requests by their processing. The value of N and the vertical scale are dis- played in the top left corner. The horizontal scale is logarithmic. Hits are marked with a pipe character ("|"), and misses are marked with a hash character ("#"). The following options are available: -b Include log entries which result from communication with a backend server. If neither -b nor -c is specified, varnishhist acts as if they both were. -C Ignore case when matching regular expressions. -c Include log entries which result from communication with a client. If neither -b nor -c is specified, varnishhist acts as if they both were. -d Process old log entries on startup. Normally, varnishhist will only process entries which are written to the log after it starts. -I regex Include log entries which match the specified regular expression. If neither -I nor -i is specified, all log entries are included. -i tag Include log entries with the specified tag. If neither -I nor -i is specified, all log entries are included. -m tag:regex only count transactions where tag matches regex. Multiple -m options are AND-ed together. -n Specifies the name of the varnishd instance to get logs from. If -n is not specified, the host name is used. -r file Read log entries from file instead of shared memory. -V Display the version number and exit. -w delay Wait at least delay seconds between each update. The default is 1. file instead of displaying them. The file will be overwritten unless the -a option was specified. -X regex Exclude log entries which match the specified regular expression. -x tag Exclude log entries with the specified tag. SEE ALSO
o varnishd(1) o varnishlog(1) o varnishncsa(1) o varnishstat(1) o varnishtop(1) HISTORY
The varnishhist utility was developed by Poul-Henning Kamp in cooperation with Verdens Gang AS and Varnish Software AS. This manual page was written by Dag-Erling Smorgrav. COPYRIGHT
This document is licensed under the same licence as Varnish itself. See LICENCE for details. o Copyright (c) 2006 Verdens Gang AS o Copyright (c) 2006-2011 Varnish Software AS AUTHOR
Dag-Erling Smorgrav 1.0 2010-05-31 VARNISHHIST(1)
All times are GMT -4. The time now is 06:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy