From 5247eaccc3ddfe3b0aed533e40723d040904a976 Mon Sep 17 00:00:00 2001 From: Daniel Mendes Date: Fri, 14 Aug 2020 14:55:00 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Tim Bannister --- content/en/docs/reference/kubectl/jsonpath.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/content/en/docs/reference/kubectl/jsonpath.md b/content/en/docs/reference/kubectl/jsonpath.md index 9e483e443c..6ca252082d 100644 --- a/content/en/docs/reference/kubectl/jsonpath.md +++ b/content/en/docs/reference/kubectl/jsonpath.md @@ -100,12 +100,16 @@ kubectl get pods -o=jsonpath="{range .items[*]}{.metadata.name}{\"\t\"}{.status. {{< note >}} -JSONPath RegEx are currently not supported. You must use jq or similar. +JSONPath regular expressions are not supported. If you want to match using regular expressions, you can use a tool such as `jq`. Example currently not supported ```shell +# kubectl does not suport regular expressions +# The following command does not work kubectl get secrets -o jsonpath='{.items[?(@.metadata.name=~/^test$/)].metadata.name}' + +# The following command achieves the same result +kubectl get secrets -o json | jq '[needs actual example code writing before merge]' ``` {{< /note >}} -