Tag Archives: grep

Piping debug output through grep

Would seem straight-forward, but it gave me a google challenge tonight.

iscsiadm -m node -d 8

Run it.  Well, if you use iscsi, that is. — that was my test tonight.

I was looking for the selective, ‘grepped’ output of:

node.session.err_timeo.lu_reset_timeout

But, when I ran iscsiadm -m node -d 8 | grep timeo.lu — it didn’t give me just those matches.

The man page failed me, so I found a reference to “|&” — so, gave it a go, with success!

# iscsiadm -m node -d 8 |& grep timeo.lu
iscsiadm: updated 'node.session.err_timeo.lu_reset_timeout', '30' => '30'
iscsiadm: updated 'node.session.err_timeo.lu_reset_timeout', '30' => '30'
iscsiadm: updated 'node.session.err_timeo.lu_reset_timeout', '30' => '30'
iscsiadm: updated 'node.session.err_timeo.lu_reset_timeout', '30' => '30'