Sponsored Content
Full Discussion: grep a range of time & date
Special Forums UNIX Desktop Questions & Answers grep a range of time & date Post 302586728 by boaz733 on Tuesday 3rd of January 2012 05:41:21 AM
Old 01-03-2012
grep a range of time & date

how can i grep a range?
i have a text file with the following text:
Code:

result.log.00:2012/01/02 12:00:07.422    LOG STARTED HERE
  N6Kashya29MemoryShieldScheduler_AO_IMPLE, pid=8662/8658,
config=(alertThreshold=10,alertLevel=0,killThreshold=7200,coreThreshold=0,full=1),
deltaTime=0,
cmd=N6Kashya59MemoryShieldScheduler_AO_IMPL_printStatistics_6_CmdConcreteE
2012/01/02 16:53:18.228 - #0 - 8662/8658 - MemoryShield: errno=0 Assertionresult.log.00:2012/01/02 12:22:36.558  
 result.log.00:2012/01/02 19:39:33.562    LOG STARTED HEREN6Kashya29MemoryShieldScheduler_AO_IMPLE, pid=8662/8658,
result.log.00:2012/01/03 12:00:08.444   LOG STARTED  HERE
config=(alertThreshold=10,alertLevel=0,killThreshold=7200,coreThreshold=0,full=1),
deltaTime=0,
cmd=N6Kashya59MemoryShieldScheduler_AO_IMPL_printStatistics_6_CmdConcreteE
2012/01/02 16:53:18.228 - #0 - 8662/8658 - MemoryShield: errno=0 Assertionresult.log.15.gz:2012/01/02 10:13:20.809    

  result.log.00:2012/01/03 12:00:09.333    LOG STARTED HERE

for example grep a range of of 2012/01/02 12:00:07 up to 2012/01/03 12:00:08 will return:

Code:
result.log.00:2012/01/02 12:00:07.422    LOG STARTED  HERE
  N6Kashya29MemoryShieldScheduler_AO_IMPLE, pid=8662/8658,
config=(alertThreshold=10,alertLevel=0,killThreshold=7200,coreThreshold=0,full=1),
deltaTime=0,
cmd=N6Kashya59MemoryShieldScheduler_AO_IMPL_printStatistics_6_CmdConcreteE
2012/01/02 16:53:18.228 - #0 - 8662/8658 - MemoryShield: errno=0  Assertionresult.log.00:2012/01/02 12:22:36.558  
 result.log.00:2012/01/02 19:39:33.562    LOG STARTED  HEREN6Kashya29MemoryShieldScheduler_AO_IMPLE, pid=8662/8658,
result.log.00:2012/01/03 12:00:08   LOG STARTED  HERE

thank u for your help.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Backup Date & Time

:confused: I'm not really sure about the default backup date & time in our Unix system and I would like to change it to a convienient time...how do I do that? Please help? (1 Reply)
Discussion started by: EbeyeJJ
1 Replies

2. Shell Programming and Scripting

Convert Epoch Time to Standard Date and Time & Vice Versa

Hi guys, I know that this topic has been discuss numerous times, and I have search the net and this forum for it. However, non able to address the problem I faced so far. I am on Solaris Platform and unable to install additional packages like the GNU date and gawk to make use of their... (5 Replies)
Discussion started by: DrivesMeCrazy
5 Replies

3. Shell Programming and Scripting

grep - date & time range

Hi, I need to search email files by date & time range in email files. The timezone is not important. Can someone plz advise how i can do this ? For e.g A user can specify only A single date A date range date & time range Below is part of the email file. (4 Replies)
Discussion started by: coolatt
4 Replies

4. Shell Programming and Scripting

About date & time difference

Hello All, I was having a look on threads on the Forum about time calculation but didn't find exactly this issue. For instance, if we have these 2 dates, begin & end : 20100430235830 20100501000200 Is there anyway, awk, ksh, perl to calculate the difference in sec and get for... (6 Replies)
Discussion started by: rany1
6 Replies

5. Shell Programming and Scripting

Grep by range of date from file creation in directory

Hi Expert, Need your scripting and finding data so that it help me to find the culprit of this memory usage error. Data provided here is a sample. Process Snapshot directory: /var/spool/processes-snapshot webdev9o9% pwd /var/spool/processes-snapshot webdev9o9% ls -lrct -rw-r--r-- ... (3 Replies)
Discussion started by: regmaster
3 Replies

6. Shell Programming and Scripting

Date and time range extraction via Awk or analysis script?

Hello does anyone know of an awk that will extract log file entries between a specific date and time range, eg: awk '/15\/Dec\/2010:16:10:00/, /15\/Dec\/2010:16:15:00/' access_log but one that works? Or a free command line log file analysis tool/script? I'd like to be able to view... (2 Replies)
Discussion started by: competitions
2 Replies

7. Programming

DATE & TIme

Can we select the datetime from oracle database in “hhmmssnnnccyymmdd” format ? please help to solve this..... (2 Replies)
Discussion started by: Sanal
2 Replies

8. Shell Programming and Scripting

How to put date range from a perl & sql script

Hi Guys, Can someone please help me on adding/inserting a variable date to an sql scipt? Basically I want to assign a 7 days date range. As shown below.. #!/usr/bin/perl use strict; use Env qw(ORACLE_HOME); my $SQLPLUS='/opt/oracle/product/10.1.0/db_1/bin/sqlplus -S... (1 Reply)
Discussion started by: pinpe
1 Replies

9. Shell Programming and Scripting

run script in time and date range

i need to run one script inside of other, and there is some terms - main script in scheduled in cron for everyday runing every 5min - i need to run /tmp/script2.sh after first 3 days in month - i need to run /tmp/script2.sh from 7-9AM, main script is runining all day all recommendations are... (1 Reply)
Discussion started by: waso
1 Replies

10. Shell Programming and Scripting

Grep in a log file within a time range (hour)

Hi, im trying to write a grep script that returns me the last inputs added in the last hour in the log file. Literally i have nothing yet but: grep 'Line im looking for' LOGFILE.log | tail -1 this only gives me the last input, but no necessarily from the last hour. Help Please. (4 Replies)
Discussion started by: blacksteel1988
4 Replies
set_color(1)							       fish							      set_color(1)

NAME
set_color - set_color - set the terminal color set_color - set the terminal color Synopsis set_color [-v --version] [-h --help] [-b --background COLOR] [COLOR] Description Change the foreground and/or background color of the terminal. COLOR is one of black, red, green, brown, yellow, blue, magenta, purple, cyan, white and normal. o -b, --background Set the background color o -c, --print-colors Prints a list of all valid color names o -h, --help Display help message and exit o -o, --bold Set bold or extra bright mode o -u, --underline Set underlined mode o -v, --version Display version and exit Calling set_color normal will set the terminal color to whatever is the default color of the terminal. Some terminals use the --bold escape sequence to switch to a brighter color set. On such terminals, set_color white will result in a grey font color, while set_color --bold white will result in a white font color. Not all terminal emulators support all these features. This is not a bug in set_color but a missing feature in the terminal emulator. set_color uses the terminfo database to look up how to change terminal colors on whatever terminal is in use. Some systems have old and incomplete terminfo databases, and may lack color information for terminals that support it. Download and install the latest version of ncurses and recompile fish against it in order to fix this issue. Version 1.23.1 Sun Jan 8 2012 set_color(1)
All times are GMT -4. The time now is 06:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy