Skip to content

Instantly share code, notes, and snippets.

@nad2000
Created June 24, 2014 01:46
Show Gist options
  • Save nad2000/8d7969b741d253a00811 to your computer and use it in GitHub Desktop.
Save nad2000/8d7969b741d253a00811 to your computer and use it in GitHub Desktop.
Pattern matching for $1 = '6028276268421821235', $2 = '6028276268851317965', $3 = '85899200', $4 = NULL, $5 = NULL, $6 = NULL, $7 = 'byte', $8 = '10' and $1 = '6028276268421821235', $2 = '6028276268851317965', $3 = '85899200', $4 = NULL, $5 = NULL, $6 = NULL, $7 = 'byte', $8 = '10'
grep -E "\\\$1 = '[0-9]+', \\\$2 = '[0-9]+', \\\$3 = '[0-9]+', \\\$4 = '[0-9]+'" /endace/pgsql/pg_log/postgresql-24.log | sed -n "s/.*'\([0-9]*\)'.*'\([0-9]*\)'.*'\([0-9]*\)'.*'\([0-9]*\)'.*/\1,\2,\3,\4/p"
grep -E "\\\$1 = '[0-9]+', \\\$2 = '[0-9]+', \\\$3 = '[0-9]+', \\\$4 = NULL, \\\$5 = NULL, \\\$6 = NULL, \\\$7 = 'byte'" /endace/pgsql/pg_log/postgresql-24.log | sed -n "s/.*'\([0-9]*\)'.*'\([0-9]*\)'.*'\([0-9]*\)'.*'\([0-9]*\)'.*/\1,\2,\3,\4/p"
grep -E "\\\$1 = '[0-9]+', \\\$2 = '[0-9]+', \\\$3 = '[0-9]+', \\\$4 = NULL, \\\$5 = NULL, \\\$6 = NULL, \\\$7 = 'byte'" /endace/pgsql/pg_log/postgresql-24.log | sed -n "s/.*'\([0-9]*\)'.*'\([0-9]*\)'.*'\([0-9]*\)'.*'\([0-9]*\)'.*/\1,\2,\3,\4/p" | awk -F, '{print $1,$2,$3,$4, $2-$1}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment