Linux Web Server Web site Failure Analysis Common Command article directory [hidden] system connection Status: Web site Log Analysis 1 (Apache): Database of the system debug analysis of the System Connection status chapter:1. View TCP connection Status netstat-nat |awk'{print $6}'|sort|uniq-c|sort-Rnnetstat-N | Awk'/^tcp/{++s[$NF]}; END {for (a in S) print A, S[a]}'netstat-N | Awk'/^tcp/{++state[$NF]}; END {for (key in) print key, "T", State[key]}'netstat-N | Awk'/^tcp/{++arr[$NF]}; END {for (k
Linux Web Server Web site failure analysis, the specific contents are as follows
System Connection Status article:
1. View TCP connection Status
Netstat-nat |awk ' {print $} ' |sort|uniq-c|sort-rn
netstat-n | awk '/^tcp/{++s[$NF]}; End {for (a in S) print A, s[a]} ' or
netstat-n | awk '/^tcp/{++state[$NF]}; End {for (key) print key, "\ T", State[key]} '
netstat-n | awk '/^tcp/{++arr[$NF]}; End {to (k in arr) print K, "T", arr[k]} '
netstat-n |awk '/^tcp/{print $NF} ' |sort|uniq-c|sor
);
L= (strlen (str) +1)/2;
s= (unsigned short *) str;
for (i=0 I
Ret^= (s[i]
return (ret);
} */
/* The following hash seems to work very down on normal text strings
* No collisions on/usr/dict/words and it distributes on%2^n quite
* Very, not as good as MD5, but still good.
*/
unsigned long lh_strhash (const char *c)
{
unsigned long ret=0;
Long N;
unsigned long V;
int R;
if ((c = = NULL) | | (*c = = "))
return (ret);
/*
unsigned char b[16];
MD5 (C,strlen (c), b);
Return (b[0]| ( B[1]
*/
n=0x100;
= $v assigns a V value to Var, and if there are multiple variables to be assigned, write multiple-V, and each variable assignment corresponds to a-Ve.g. to print the line between the NUM line of file A and the Num+num1 line,Awk-v num= $num-v num1= $num 1 ' nr==num,nr==num+num1{print} ' a-F Progfile: Allows awk to invoke and execute Progfile Program files, of course Progfile must be a program file that confo
relationship ...Iv. data abstraction of the kernel state1, how to abstract PID number?
struct Upid {int nr;struct Pid_namespace *ns;struct Hlist_node pid_chain;};
Although user space uses a positive integer to represent various IDs, for the kernel, we need to use a two-tuple (PID namespace,id number) to represent, because the pure PID number is meaningless, must limit its PID namespace, Only then, that ID number is the only one. In this
Tags: address GRE 80 Port link Adjust SED calculation comparison totalI. Analysis log1. See how many IP access' {print $} ' log_file|sort|uniq|wc-l2. View the number of times a page has been accessed" /index.php " Log_file | Wc-l3. See how many pages each IP visited' {++s[$1]} END {for (a in S) print A,s[a]} ' log_file >'2 log.txt #配合sort进一步排序4, the number of pages per IP access from small to large sort' {++s[$1]} END {for (a in S) print S[a],a} ' log_file | Sort-n5. See which pages a certain
restriction of "condition type", the following "action" should be judged.
Finish all the action and condition types;
If there are subsequent "rows" of data, repeat the above steps until all the data has been read out.
After this step, you will know that awk is "the unit that behaves once", and "the smallest processing unit in a field." Okay, so how does awk know how many lines I have on this data? How many columns do you have? This will require the help of Awk's built-in variables.
To the photographic enthusiasts to share a detailed analysis of the Canon 7D camera evolution of high ISO speed noise reduction function.
Share list:
Key points for flexible application:
1, using a tripod shooting, even if the night scene photography can be in the ISO 3200 will be "NR" set to "close" to retain sharp detail performance.
2, raw imaging is the key to skilled use of noise reduction level. Adjust the parameters, the decision is priorit
System Connection Status Chapter:1. View TCP connection StatusNetstat-nat |awk '{print $6}'|Sort|Uniq-c|Sort-Rnnetstat-N |awk '/^tcp/{++s[$NF]}; END {for (a in S) print A, S[a]}'or netstat-N |awk '/^tcp/{++state[$NF]}; END {for (key in) print key, "\ T", State[key]}'netstat-N |awk '/^tcp/{++arr[$NF]}; END {for (k in arr) print K, "T", Arr[k]}'netstat-N |awk '/^tcp/{print $NF}'|Sort|Uniq-c|Sort-Rnnetstat-ant |awk '{print $NF}'|grep-V'[A-z]'|Sort|Uniq-C2. Find the number of requests 20 IP (commonl
1} Condition Type 2 {Action 2 }.... End {post-processing }'The statements in begin and end play a role before and after reading the file (in_file). They can be understood as initialization and scanning.(1) parameter description:-F re: Allows awk to change its field separator-V Var = $ V: Assign the value of V to var. If multiple variables need to be assigned a value, write multiple-v values. Each variable corresponds to one-V value.E.g. Print the row from row num of file a to row num + num1,Awk
] 'begin{ initialization} Condition Type 1 {Action 1} Condition Type 2 {Action 2 }.... END {post-processing }'The statements in BEGIN and END play a role before and after reading the file (in_file). They can be understood as initialization and scanning.(1) parameter description:-F re: Allows awk to change its field separator-V var = $ v: Assign the value of v to var. If multiple variables need to be assigned a value, write multiple-v values. Each variable corresponds to one-v value.E.g. Print th
Set ADDR's nr position to 1Assume that * ADDR = 0, Nr = 3; the execution result is 1000 (binary number)Extern _ inline _ int set_bit (int nr, long * ADDR)...{Int mask, retval;
ADDR + = nR> 5; // (1)Mask = 1 CLI ();Retval = (mask * ADDR )! = 0;* ADDR | = mask; // (3)STI ();Return retval;}(1) If
Awk command usage
Awk Programming Language/Data Processing Engine
Creator: Aho weinberger kernighan
Check input based on pattern matching (read row-by-row output)
Print the expected matching result to the screen
Syntax format:
Awk 'mode {operation}' file 1 file 2 .....
Common built-in Variables
The ordinal number of the row being processed by NR (row number)
FS fields are separated. The default value is space or Tab space.
$ N the nth field of the c
Awk command usage, awk
Awk Programming Language/Data Processing Engine
Creator: Aho weinberger kernighan
Check input based on pattern matching (read row-by-row output)
Print the expected matching result to the screen
Syntax format:
Awk 'mode {operation}' file 1 file 2 .....
Common built-in Variables
The ordinal number of the row being processed by NR (row number)
FS fields are separated. The default value is space or Tab space.
$ N the nth field of
. The nr parameter (indicating which bit to operate) is often defined as int, but in several systems it is unsigned long. the address to be modified is often an unsigned long pointer, but several systems use void * instead. Various bit operations are: void set_bit (nr, void * addr); set the nr bit in the data item pointed to by addr. Void clear_bit (
Grammar:awk ' {command} ' filename multiple commands are separated by semicolons .awk ' begin {Command1} {Command2} End{command3} ' Note: Begin, END needs to be capitalizedCommon Variable Description:FS: Specifies the delimiter, which is the default Space and tab. You can also abbreviate-F ";"NR: Currently dealing with the "number of rows" of data, the row label in the fileNF: Number of columns per row (segment, field)Example 1:# with TAB as delimiter
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.