All those cats are completely useless, see useless use of cat award. They are particularly harmful on Windows, whose scheduler deals badly with too many short-lived programs.
If you rearrange your dates into YYYY/MM/DD HH:MM:SS order they easily compare alphabetically, which is why the rest of the world has converted to this order. You can do this rearranging inside awk, though a lookup table of month names is needed.
If awk doesn't work, try gawk or nawk.
Last edited by Corona688; 10-14-2014 at 12:54 PM..
give me a shell-script which extract data from log file on a server by giving date and time as input (for both start time and end time) and it will give the logs generated during the given time as output. (4 Replies)
Hi , I am having a script which will start a process and appends the process related logs to a log file. The log file writes logs with every line starting with date in the format of: date +"%Y %b %d %H:%M:%S".
So, in the script, before I start the process, I am storing the date as DATE=`date +"%Y... (5 Replies)
Dear All,
Please apology to me if this question already posted, because I try to find it but not found.
I have make bash script to automatically download data from ftp and this running very well. and after the data downloaded it will automatically extract the data and keep in the specific... (2 Replies)
Looking for a shell script or a simple perl script . I am new to scripting and not very good at it .
I have 2 directories . One of them holds a text file with list of files in it and the second one is a daily log which shows the file completion time. I need to co-relate both and make a report.
... (0 Replies)
If I have a log like :
Mon Jul 19 05:07:34 2010; TCP; eth3; 52 bytes; from abc to def
Mon Jul 19 05:07:35 2010; UDP; eth3; 46 bytes; from aaa to bbb
Mon Jul 19 05:07:35 2010; TCP; eth3; 52 bytes; from def to ghi
I will need an output like this :
Time abc to def... (1 Reply)
Please help me out to extract the Data from the XML Log files.
So here is the data
ERROR|2010-08-26 00:05:52,958|SERIAL_ID=128279996|ST=2010-08-2600:05:52|DEVICE=113.2.21.12:601|TYPE=TransactionLog... (9 Replies)
I was searching for parsing a log file and found what I need in this link
http://stackoverflow.com/questions/7575267/extract-data-from-log-file-in-specified-range-of-time
But the most useful answer (posted by @Kent):
# this variable you could customize, important is convert to seconds.
# e.g... (2 Replies)
Hi,
I am trying to extract lines of data within a log file on a Redhat 5 Linux system.
eg I need all the lines with a particular username over the last 3 minutes.
the log file may read like this, and I want a way to search all the lines extracting all the relevant lines over the last 3... (2 Replies)
Hi,
I have a log file that gets updated every second. Currently the size has grown to 20+ GB. I need to have a command/script, that will try to get the actual size of the file and will remove 50% of the data that are in the log file. I don't mind removing the data as the size has grown to huge... (8 Replies)
Hi, I would like to seek your help for a script that will extract data from log file and put it in a file.
Sample log file
2018-10-23 12:33:21 AI ERROR -- tpid: SAMPLE_TH account: 123456789 aiSessionNumber: 660640464 mapName: xxx to yyy
errorDesc: Translation Error:ErrorNumber : 993 ... (2 Replies)
Discussion started by: neverwinter112
2 Replies
LEARN ABOUT OSF1
log
log(8) System Manager's Manual log(8)NAME
log - Records input and output from a program
SYNOPSIS
/usr/sbin/log <logfile> <command>
OPERANDS
The file in which to record the interaction being logged. The command to execute.
DESCRIPTION
The log program runs <command> and logs the input to and output from <command> to the <logfile> file. Input and output are logged until
<command> exits, the log program exits, and the exit status of <command> is returned.
The log program is used by the system installation procedure and the it(8) command to create the /var/adm/smlogs/install.log and
/var/adm/smlogs/it.log installation log files.
RESTRICTIONS
Because the log program is used in the installation standalone environment, program size was the greatest concern in its implementation.
The log program does not search for the PATH variable to locate <command> and error messages are terse.
The log program causes <command> to take standard input from and write standard output and standard error to UNIX pipes. Some commands
will not be able to operate in this environment; therefore, it is suggested that you use the script(1) command instead. UNIX shells will
not issue prompts when run from log unless the shell is started with an explicit interactive switch (-i for most shells). For example, log
foo.tmp /sbin/sh -i
In the previous example, foo.tmp is the name of <logfile>.
The log program intercepts end-of-file (usually Ctrl/d). Therefore programs which normally receive end-of-file as an exit command must
exit by some other means.
ERRORS
Log open error
Explanation:
The log program was unable to open <logfile>. Verify that the directory exists and that ownerships and permissions are set correctly.
Exec Error
Explanation:
The log program was unable to execute <command>. Verify that you specified a full pathname for <command> and that <command> is an exe-
cutable file.
Fork Error
Explanation:
The log program was unable to create one of the processes it requires to log data.
SEE ALSO
Commands: it(8), script(1)log(8)