Skip to content

Instantly share code, notes, and snippets.

@nhoag
Created December 23, 2015 18:55
Show Gist options
  • Save nhoag/6d4dc33feb64c7c7fc29 to your computer and use it in GitHub Desktop.
Save nhoag/6d4dc33feb64c7c7fc29 to your computer and use it in GitHub Desktop.

Revisions

  1. nhoag revised this gist Dec 23, 2015. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions bandwidth-per-min.sh
    Original file line number Diff line number Diff line change
    @@ -2,11 +2,11 @@

    cat access.log \
    | awk -F' ' '{
    time = substr($4, 2, 17);
    times[time] = time;
    bandwidth[time] += $10
    } END {
    for (t in times) print times[t],bandwidth[t]/1024/1024
    }' \
    time = substr($4, 2, 17);
    times[time] = time;
    bandwidth[time] += $10
    } END {
    for (t in times) print times[t],bandwidth[t]/1024/1024
    }' \
    | column -t \
    | sort
  2. nhoag created this gist Dec 23, 2015.
    12 changes: 12 additions & 0 deletions bandwidth-per-min.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    #!/bin/bash

    cat access.log \
    | awk -F' ' '{
    time = substr($4, 2, 17);
    times[time] = time;
    bandwidth[time] += $10
    } END {
    for (t in times) print times[t],bandwidth[t]/1024/1024
    }' \
    | column -t \
    | sort