diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh
index 2b93c1848523998fbcc55349c457d2a49c1b3456..74b4c5faaad8d455fb8a46a80aa9cf3db1e59cc3 100644
--- a/lustre/tests/test-framework.sh
+++ b/lustre/tests/test-framework.sh
@@ -1057,6 +1057,7 @@ log() {
     MSG=${MSG//\(/\\\(}
     MSG=${MSG//\)/\\\)}
     MSG=${MSG//\;/\\\;}
+    MSG=${MSG//\|/\\\|}
     local NODES=$(nodes_list)
     for NODE in $NODES; do
         do_node $NODE $LCTL mark "$MSG" 2> /dev/null || true