Adventures in Networking

Main menu:

Summarize Unique IP Addresses in a Log File

Loops through each log file and dump output to a single file:

for file in `ls *.log`
cat $file |awk '{print $4}' |sort |uniq -c |sort -n >> output.txt


Now consolidate entries from each section of original file to a new file:

cat output.txt |awk '{print $2}' |sort |uniq -c |sort -n >> output2.txt

Where the $4 or $2 is the field to look at (space delimitated)

Write a comment