08-19-2011
return counting per hour percentage
We have a monitoring process for a load in unix box, during this process we are writing logs statements for each record, and during this process we are showing the counts per hour. Here is that how we are following
log files statements: (just two lines printed here), these statements logged at 08:09 AM
08-19 08:09:32 APIDBManager 12752 INFO Successfull saving person to database, the saved ID: 114285
08-19 08:09:32 APIDBManager 12752 INFO Successfull saving person to database, the saved ID: 114286
Command to get the counts per each hour (time):
> grep 'Successfull saving person to database, the saved ID:' api_database_manager.log | awk '{ print $2 }' | awk -F':' '{ print $1 }' | uniq -c
>
20587 08
23102 09
So the above command gave the 20587 saved counts between 08:00 AM & 08:59 and 23102 saved counts between 09:00 & 09:59.
Here it good so far, but we see some counts in difference between hours 08 and 09. For this we need to display the percentage of counts increased or decreased (in -ve), so please how do we get this from command? You advice is very important to grab the attention from my top.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
My program:
__________________________________
#!/bin/ksh
DAY=`date +%y%m%d`
H=`date +%H`
M=`date +%M`
day=`date +%m/%d/%y`
let h=$H-1
echo DAY $DAY
echo H $H
echo M $M
echo day $day
echo h $h
_____________________________________
My result: (3 Replies)
Discussion started by: bobo
3 Replies
2. UNIX for Dummies Questions & Answers
Hi All,
Can anyone please let me know the syntax / how to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 'system()' function and '${?}'.
I am in a process to send the mail automatically with an attachment to bulk users. I have used 'Mailx' and 'Unencode'... (0 Replies)
Discussion started by: manas6
0 Replies
3. Shell Programming and Scripting
i have 3 files like
total.dat=18
equal.dat=14
notequal.dat=16
i need find the equal percentange means:
equalpercentage = ($equal.dat / $total.dat * 100)
How i can do this ?
I tried some of the answers to calculate the percentage in this forums.but it couldn't worked.Some one please... (6 Replies)
Discussion started by: bobprabhu
6 Replies
4. UNIX for Dummies Questions & Answers
How to calculate percentage of two values in unix. (5 Replies)
Discussion started by: venkatesht
5 Replies
5. Shell Programming and Scripting
Hi i have log like this :
Actually i will process the data become
Anybody can help me ? (6 Replies)
Discussion started by: justbow
6 Replies
6. Shell Programming and Scripting
Hello,
I try to insert a post because I've got a trouble to perform a unix job. But I didn't found which steps (procedure) I should follow. Could you help me?
I got a log by my Application box, like following:
gbosmam037:test >view Log_Server.csv
... (2 Replies)
Discussion started by: maluca68
2 Replies
7. Shell Programming and Scripting
Hi friends, I want to convert 24 hour timing to 12 hour please help me...
my data file looks like this..
13-Nov-2011 13:27:36 15.32044 72.68502
13-Nov-2011 12:08:31 15.31291 72.69807
16-Nov-2011 01:16:54 15.30844 72.74028
15-Nov-2011 20:09:25 15.35096 ... (13 Replies)
Discussion started by: nex_asp
13 Replies
8. Shell Programming and Scripting
Hi,
I am looking for generic commands / scripts that could run across platforms especially on HP Itanium boxes to give me % of free OS parameters
For eg:
Free Total Memory RAM : 20 %
Free Total Swap Memory: 35%
Free Total CPU utilisation: 44%
Free Disk Space: /appl = 55%... (5 Replies)
Discussion started by: mohtashims
5 Replies
9. Shell Programming and Scripting
Hi,
I have a text file in below format.
I trying to find a solution for finding percentage used for each of the NAMEs.
Directory ALLOCATED USED
NAME1 93MB 93KB
NAME2 25G 62K
NAME3 14G 873M
NAME4 25G 62K
NAME5 20G... (10 Replies)
Discussion started by: ctrld
10 Replies
10. Shell Programming and Scripting
Not sure where the problem is. I can run the script without any issue using the following command.
. /opt/app/scripts/cdc_migration.sh
But it fails with the below error when I try it this way
/opt/app/scripts/cdc_migration.sh
/opt/app/scripts/cdc_migration.sh: line 65: return: can only... (1 Reply)
Discussion started by: svajhala
1 Replies
WC(1) User Commands WC(1)
NAME
wc - print newline, word, and byte counts for each file
SYNOPSIS
wc [OPTION]... [FILE]...
wc [OPTION]... --files0-from=F
DESCRIPTION
Print newline, word, and byte counts for each FILE, and a total line if more than one FILE is specified. With no FILE, or when FILE is -,
read standard input. A word is a non-zero-length sequence of characters delimited by white space. The options below may be used to select
which counts are printed, always in the following order: newline, word, character, byte, maximum line length.
-c, --bytes
print the byte counts
-m, --chars
print the character counts
-l, --lines
print the newline counts
--files0-from=F
read input from the files specified by NUL-terminated names in file F; If F is - then read names from standard input
-L, --max-line-length
print the length of the longest line
-w, --words
print the word counts
--help display this help and exit
--version
output version information and exit
GNU coreutils online help: <http://www.gnu.org/software/coreutils/> Report wc translation bugs to <http://translationproject.org/team/>
AUTHOR
Written by Paul Rubin and David MacKenzie.
COPYRIGHT
Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
SEE ALSO
The full documentation for wc is maintained as a Texinfo manual. If the info and wc programs are properly installed at your site, the com-
mand
info coreutils 'wc invocation'
should give you access to the complete manual.
GNU coreutils 8.22 June 2014 WC(1)