diff --git a/cdist/conf/type/__consul_agent/manifest b/cdist/conf/type/__consul_agent/manifest
index 053c9e80..76bd6032 100755
--- a/cdist/conf/type/__consul_agent/manifest
+++ b/cdist/conf/type/__consul_agent/manifest
@@ -126,10 +126,10 @@ if [ -f "$__object/parameter/json-config" ]; then
    if [ "$json_config" = "-" ]; then
       json_config="$__object/stdin"
    fi
-   printf ','
-   # remove trailing ,
-   json=$(cat "$json_config")
-   echo "${json%*,}"
+   # remove leading and trailing whitespace and commas from first and last line
+   # indent each line with 3 spaces for consistency
+   json=$(sed -e 's/^[ \t]*/   /' -e '1s/^[ \t,]*//' -e '$s/[ \t,]*$//' "$json_config")
+   printf '   ,%s\n' "$json"
 fi
 echo "}"
 ) | \