First, the text processing
1. Extract key word frequency times by row (for example, 5th column)
awk ' begin{fs= ' | '} {a[$5]+=1;} END {for (i in a) print I ":" A[i];} ' Opt. Forumlogicnewserver_action_20161107.log | SORT-NRK 2-t ': '
2, log users per minute traffic statistics
Here we count the traffic per minute arrival rate for the "getthreadlist" interface in the log.
awk ' begin{fs= ' | '} $5== "Getthreadlist" {a[substr ($1,0,16)]+=1;} End{for (i in a) print I "\ T" a[i]} ' OPT. Forumlogicnewserver_action_20161107.log | Sort > GetThreadList.txt
3. Find all the binaries in a directory
LS-LRT | awk ' {print $9} ' | Xargs File | grep ELF | awk ' {print '} ' | Tr-d ': '
4, grep ' 2016-11-21 22:05 ' MTT. Idcenterserver_idcenterserver_20161121.log | grep ' UserInfo ' | awk ' begin{fs= ' | '} {print $6} ' | Uniq | Wc-l
Shell awk Combat