0

I am stuck with logic realization in linux, bash. Actually I am new in shell scripting in linux.

The aim is to extract data from log file in specified range of time. Logfile: test.log It has huge data inside. Logic is job runs on 05-FEB-2016 at 9:00 AM, it checks target LOG file and extracts all lines between 04-FEB-2016 15:00:00 PM and 05-FEB-2016 09:00:00 AM.

I used the command:

sed -n '/Feb 04/,/Feb 05/p' test.log

But it does not do what I need. If someone came across with that problem, please share!

With regards!

Jens
  • 67,715
  • 15
  • 98
  • 113
Bulat Makhmutov
  • 555
  • 2
  • 8
  • 14
  • 1
    Format of your logfile?? – sat Feb 05 '16 at 07:40
  • 1
    `Feb` and `FEB` are different strings. – choroba Feb 05 '16 at 07:44
  • Format of logfile - actually it is Oracle Alert file, not any special characters exist in the alert file. extracted from that file: `Thu Feb 04 22:00:00 2016 Setting Resource Manager plan SCHEDULER[0x32DC]:DEFAULT_MAINTENANCE_PLAN via scheduler window Setting Resource Manager plan DEFAULT_MAINTENANCE_PLAN via parameter Thu Feb 04 22:00:00 2016 Starting background process VKRM Thu Feb 04 22:00:00 2016 VKRM started with pid=29, OS id=27108 Fri Feb 05 02:00:00 2016 Closing scheduler window Closing Resource Manager plan via scheduler window Clearing Resource Manager plan via parameter` – Bulat Makhmutov Feb 05 '16 at 09:57

0 Answers0