handling non json lines as raw with red color

mine
Gergely Tankovics 2020-11-30 09:45:37 +01:00
parent 68981ff500
commit 02bda720c0
1 changed files with 1 additions and 1 deletions

View File

@ -1,3 +1,3 @@
#!/bin/bash #!/bin/bash
/usr/local/bin/kubectl logs -f $1 -n $2 --context $3 | jq -r '.message' /usr/local/bin/kubectl logs -f $1 -n $2 --context $3 | jq -rR '. as $raw | try (fromjson | .message) catch ("\u001b[31m" + $raw + "\u001b[0m")'