mirror of https://github.com/istio/istio.io.git
Format the output of curl to json. (#1468)
This commit is contained in:
parent
05cc317b2d
commit
31ab3dece9
|
@ -155,7 +155,7 @@ Let's set up a scenario to demonstrate the traffic-mirroring capabilities of Ist
|
||||||
|
|
||||||
```command-output-as-json
|
```command-output-as-json
|
||||||
$ export SLEEP_POD=$(kubectl get pod -l app=sleep -o jsonpath={.items..metadata.name})
|
$ export SLEEP_POD=$(kubectl get pod -l app=sleep -o jsonpath={.items..metadata.name})
|
||||||
$ kubectl exec -it $SLEEP_POD -c sleep -- sh -c 'curl http://httpbin:8080/headers'
|
$ kubectl exec -it $SLEEP_POD -c sleep -- sh -c 'curl http://httpbin:8080/headers' | python -m json.tool
|
||||||
{
|
{
|
||||||
"headers": {
|
"headers": {
|
||||||
"Accept": "*/*",
|
"Accept": "*/*",
|
||||||
|
@ -212,7 +212,7 @@ Let's set up a scenario to demonstrate the traffic-mirroring capabilities of Ist
|
||||||
Now if we send in traffic:
|
Now if we send in traffic:
|
||||||
|
|
||||||
```command
|
```command
|
||||||
$ kubectl exec -it $SLEEP_POD -c sleep -- sh -c 'curl http://httpbin:8080/headers'
|
$ kubectl exec -it $SLEEP_POD -c sleep -- sh -c 'curl http://httpbin:8080/headers' | python -m json.tool
|
||||||
```
|
```
|
||||||
|
|
||||||
We should see access logging for both `v1` and `v2`. The access logs created in `v2` is the mirrored requests that are actually going to `v1`.
|
We should see access logging for both `v1` and `v2`. The access logs created in `v2` is the mirrored requests that are actually going to `v1`.
|
||||||
|
|
Loading…
Reference in New Issue