Skip to main content

Posts

Showing posts with the label awk
Marking Nepenthes' log with GeoIP I always wanted to let my Nepenthes log meaningful, rather than cryptic columns which is pretty much boring. So this is what I did after several searches on the Net... some of the link just show the result, and I wonder why don't they just *put* the script online. Here goes! Let say, I am processing /var/log/nepenthes/logged_downloads 116.7.16.130 df51e3310ef609e908a6b487a28ac068 116.80.225.172 1d419d615dbe5a238bbaa569b3829a23 116.80.227.106 e269d0462eb2b0b70d5e64dcd7c676cd 116.80.81.221 98eb0fdadf8a403c013a8b1882ec986d 116.80.85.224 e269d0462eb2b0b70d5e64dcd7c676cd 116.81.88.146 2fa0e36b36382b74e6e6a437ad664a80 I want it to be: Russian Federation ,95.28.56.118 , 7d99b0e9108065ad5700a899a1fe3441 Russian Federation ,95.28.63.209 , 7d99b0e9108065ad5700a899a1fe3441 Russian Federation ,95.28.71.57 , 7d99b0e9108065ad5700a899a1fe3441 Russian Federation ,95.28.82.129 , 7d99b0e9108065ad5700a899a1fe3441 Russian Federation ,95.28.89.135 , 7d99b0e910...
Awk, sort and friends Najmi@Najmi ~ $ cat fileasal.txt #436 UMKC #446 Charlotte #353 QUT #325 Kent State #259 Missippi State #278 VCU #202 Wayne State #100 U New Mexico #27 Indiana University #1003 Missouri University of Science and Technology #265 University of Idaho Najmi@Najmi ~ $ awk -F# {'print $1,$2'} fileasal.txt 436 UMKC 446 Charlotte 353 QUT 325 Kent State 259 Missippi State 278 VCU 202 Wayne State 100 U New Mexico 27 Indiana University 1003 Missouri University of Science and Technology 265 University of Idaho Najmi@Najmi ~ $ awk -F# {'print $1,$2'} fileasal.txt |sort -n 27 Indiana University 100 U New Mexico 202 Wayne State 259 Missippi State 265 University of Idaho 278 VCU 325 Kent State 353 QUT 436 UMKC 446 Charlotte 1003 Missouri University of Science and Technology