Skip to content

Instantly share code, notes, and snippets.

@douglascodes
Created June 29, 2018 15:47
Show Gist options
  • Save douglascodes/2653374dc5ca56fd693247dd30f07837 to your computer and use it in GitHub Desktop.
Save douglascodes/2653374dc5ca56fd693247dd30f07837 to your computer and use it in GitHub Desktop.
Awk script for taking grouped drives and outputting single line with current time. Pipe to text log
#!/usr/bin/env awk
# iostat -t -d -H -g hdds sda sdb
{OFS="\t"}
NR==3 { runtime=$1;}
NR==5 { print runtime, $1, $2, $3, $4, $5, $6}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment