Log File date compare for user defined range


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Log File date compare for user defined range
# 1  
Old 05-05-2006
Log File date compare for user defined range

Smilie Hi i am a noob and need a little help to finish my shell script. I am learning as i go but hit a problem.

I am search thorugh logs(*.rv) files to find entires between two user defined dates,

The script so far looks for the "START" and "END" of each entry at sees if it belongs To user defined ORGID number. then only take the whole record based on OGID and valid entry in the date range given


gawk '/^START/ { ok=0; sec="" } /^START/,/^END/ { sec=sec "\n" $0 }$2==274529 { ok=1 }/^END/ && ok { print sec }' *.rv>BUSORG_ORGID${BUSORG_ORGID}st${START_DAY}${START_MONTH}end${END_DAY}${END_MONTH}.txt



extract of one *.rv file

START: Mon Apr 24 10:09:19 2006:
Mon Apr 24 10:09:19 2006: service: before tpcall(), buffer being sent...
G_FLAG 0
CLFY_SUB ListBeneficiaryDetails
MESSAGE_ID C7ADAC68-DD9E-497D-BCBD-9654B9AFEDB6
BUSORG_ORGID 281688

service: now I'm sending that...
Mon Apr 24 10:09:19 2006: Mon Apr 24 10:09:20 2006: service: after tpcall(), buffer received...
E_NUMBER 2
G_FLAG 0
CLFY_SUB ListBeneficiaryDetails
E_STRING No record(s) found
MESSAGE_ID C7ADAC68-DD9E-497D-BCBD-9654B9AFEDB6
BUSORG_ORGID 281688

service: now I have received that...
Mon Apr 24 10:09:20 2006: service: field [XFDTRANSACT_XID2] not found, Ferror 4, tperrno 0
processing ends... Mon Apr 24 10:09:20 2006:
END:
START: Mon Apr 24 10:09:53 2006:
Mon Apr 24 10:09:53 2006: service: before tpcall(), buffer being sent...
CLFY_SUB ListLast50CardStatementItems
MESSAGE_ID ACDD0695-77CA-4C5F-931A-036075DFF927
BUSORG_ORGID 422345
XPRODUCT_XACCOUNTNO 570203327
XPRODUCT_XCOINTYPE DUAM
END:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to sum value of a column by range defined in another file awk?

I have two files, file1.table is the count table, and the other is the range condition file2.range. file1.table chr start end count N1 0 48 1 N1 48 181 2 N1 181 193 0 N1 193 326 2 N1 326 457 0 N1 457 471 1 N1 471 590 2 N1 590 604 1 N1 604 752 1 N1 752 875 1 file2.range... (12 Replies)
Discussion started by: yifangt
12 Replies

2. 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

3. UNIX for Advanced & Expert Users

Help with ksh script to list, then cp files from a user input date range

Hi, I'm quite new to ksh scripting, can someone help me with this. Requirements: I need to create a script that list the files from a user input date range. e. g. format of file: *c1*log.2012-12-22-14-00* *c1*log.2012-12-22-14-00* *c1*log.2012-12-22-14-00*... (1 Reply)
Discussion started by: chococrunch6
1 Replies

4. Shell Programming and Scripting

display Range of date depend on user input php

Hi, i am very new to php Is it possible to display Range of date depend on user input day example: user input 2 day start from 28/4/12 it will add 2 day from date of input so display should look like this 28/4/12 to 30/4/12 then from 30/412 user add another 4 date so will... (0 Replies)
Discussion started by: guidely
0 Replies

5. Shell Programming and Scripting

Search on date range of file based on user input

Hello I would like to ask for help with a script to search a directory that contains many log files and based on a users input after being prompted, they enter a date range down to the hour which searches the files that contain that range. I dont know how to go about this. I am hoping that the... (5 Replies)
Discussion started by: lostincashe
5 Replies

6. Shell Programming and Scripting

Number of days between the current date and user defined date

I am trying to find out the number of days between the current date and user defined date. I took reference from here for the date2jd() function. Modified the function according to my requirement. But its not working properly. Original code from here is working fine. #!/bin/sh... (1 Reply)
Discussion started by: hiten.r.chauhan
1 Replies

7. Programming

how to add user defined tag in a mp3 file?

Hai all, Can anyone explain me about how to add an user defined tag in an mp3 file using MP3::Tag module in perl? (0 Replies)
Discussion started by: thillai_selvan
0 Replies

8. Shell Programming and Scripting

Compare columns of 2 files based on condition defined in a different file

I have a control file which tells me which are the fields in the files I need to compare and based on the values I need to print the exact value if key =Y and output is Y , or if output is Y/N then I need to print only Y if it matches or N if it does not match and if output =N , then skip the feild... (7 Replies)
Discussion started by: newtoawk
7 Replies

9. Shell Programming and Scripting

How to increment a user defined date value in the DATE format itself using shell script?

I need to increment a date value through shell script. Input value consist of start date and end date in DATE format of unix. For eg. I need increment a date value of 1/1/09 to 31/12/09 i.e for a whole yr. The output must look like 1/1/09 2/2/09 . . . 31/1/09 . . 1/2/09 . 28/2/09... (1 Reply)
Discussion started by: sunil087
1 Replies

10. Shell Programming and Scripting

Selecting files between a user inputed date range

Hi all! I'm working on a KSH script to select files between a user inputed date range (stored in a variable) and then move them and unzip them. I'm stuck at how to get the files between the user inputed date range selected. Any help would be greatly appreciated! The files are as such: ... (6 Replies)
Discussion started by: kelldan
6 Replies
Login or Register to Ask a Question