Created
May 25, 2016 22:04
-
-
Save alq666/3c255e26799a35fb01733eb86ea22001 to your computer and use it in GitHub Desktop.
Parse /proc/net/netstat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/TcpExt:/ { | |
for (i=2; i <= NF; i++) { | |
if (match($i, /[[:digit:]]+/)) { | |
values[i] = $i | |
} else { | |
keys[i] = $i | |
} | |
} | |
} | |
END { for (i=1; i <= length(keys); i++) { print keys[i], values[i] }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment