response status

What is the right way to read the outgoing response status code (200 ok)

on a post proxy flow, we are loging to splunk

I'm having a problem to understand how to read the 200 or whatever status.

the documentation says response.status.code . but it shows empty.

any idea ?

0 3 302
3 REPLIES 3

@Esteban Lartigue

response.status.code is the right way to check the http response code.

"but it shows empty." - are you checking the response.status.code in post client flow?

If yes, request and response message objects are not available in post client flow. You can assign it to a variable in your proxy response preflow or postflow and then try to access it.

If you are checking response.status.code else where, can you please share the trace, so that I can help you.

you are right, Im using it in the post client flow since all my splunk logic I have it in a hook shared flow.

is this done by design ? I would assume that it would be better design to not touch any number of APIs for handling like this and centralize this kinda logic on post flow logic 😞

@Esteban Lartigue

I guess it is by design as the post client flow is executed asynchronously

You can create and hook a shared flow in proxy response preflow or postflow which copies response.status.code into a variable log.response.status.code. In the post client flow you can access log.response.status.code flow variable