Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Viewing a specific timeframe of a log file Post 302998323 by apmcd47 on Tuesday 30th of May 2017 07:08:18 AM
Old 05-30-2017
Quote:
Originally Posted by simpsa27
Thank you for this andrew. This worked! How would I go about changing the time. Not 100% sure on that part (how you got it too return 8/9:00.
I would like to be able to extract a time of 23:00 - 00:00

Cheers
Alex
Basically the [...]construct matches any of the characters inside the square brackets. So if you wanted to match any time from 03:00 to 06:59 inclusive the following expression will match:
Code:
0[3456]:[012345][0123456789]

but for a contiguous series of characters one would use a range:
Code:
0[3-6]:[0-5][0-9]

To match a time of 23:00-23:59 you need to change the 0[89] to 23. However you will need a separate expression to match 00:00 as, for one thing, this will be in the following day (say the 5th instead of the 4th).

I hope that is clear.

Andrew
This User Gave Thanks to apmcd47 For This Post:
 

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
DOVEADM-LOG(1)							      Dovecot							    DOVEADM-LOG(1)

NAME
doveadm-log - Locate, test or reopen Dovecot's log files SYNOPSIS
doveadm [-Dv] log errors [-s min_timestamp] doveadm [-Dv] log find [directory] doveadm [-Dv] log reopen doveadm [-Dv] log test DESCRIPTION
The doveadm log commands are used to locate and reopen the log files of dovecot(1). It's also possible to test the configured targets of the *log_path settings. OPTIONS
Global doveadm(1) options: -D Enables verbosity and debug messages. -v Enables verbosity, including progress counter. COMMANDS
log errors doveadm log errors [-s min_timestamp] The log errors command is used to show the last - up to 1,000 - errors and warnings. If no output is generated, no errors have occurred since the last start. -s min_timestamp An integer value, representing seconds since the epoch - also known as Unix timestamp. When a min_timestamp was given, doveadm(1) will only show errors occurred since that point in time. log find doveadm log find [directory] The log find command is used to show the location of the log files, to which dovecot(1) sends its log messages. If dovecot(1) logs its messages through syslogd(8) and doveadm(1) could not find any log files, you can specify the directory where your syslogd writes its log files. log reopen doveadm log reopen This command causes doveadm to reopen all log files, configured in the log_path, info_log_path and debug_log_path settings. These settings are configured in /etc/dovecot/conf.d/10-logging.conf. This is for example useful after manually rotating the log files. log test doveadm log test This command causes doveadm to write the message "This is Dovecot's priority log (timestamp)" to the configured log files. The used prior- ities are: debug, info, warning, error and fatal. EXAMPLE
This example shows how to locate the log files used by dovecot(1). doveadm log find Looking for log files from /var/log Debug: /var/log/dovecot.debug Info: /var/log/mail.log Warning: /var/log/mail.log Error: /var/log/mail.log Fatal: /var/log/mail.log REPORTING BUGS
Report bugs, including doveconf -n output, to the Dovecot Mailing List <dovecot@dovecot.org>. Information about reporting bugs is avail- able at: http://dovecot.org/bugreport.html SEE ALSO
doveadm(1) Dovecot v2.2 2013-11-24 DOVEADM-LOG(1)
All times are GMT -4. The time now is 01:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy