cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Response.StatusCode is not showing

Hello everyone,

we have created a rule that only triggers if the response code is 502 in the response cycle. When I try to check if it has been triggered in the rule tracing centre, the ruleset does not show up. Also in the "Cycle" drop down only "All, Request" is shown but no response. Does it need to be enabled separately?

5 Replies
fw_mon
Reliable Contributor
Reliable Contributor
Report Inappropriate Content
Message 2 of 6

Re: Response.StatusCode is not showing

Hello @User99518290 

right, there is not 502 in response, unless it comes from an upstream proxy.

In a normal case, say if a timeout occurs, there is no "response", the proxy either cannot connect to destination if the DNS resolution fails, there is no "response" if the proxy runs in a timeout, or receives a TCP RESET. So the 502 is thrown by the proxy module itself and not by the rule set. There is no way to do something in the current transaction, because it is over and terminated.

What you need to do as an action if the response code 502 returned back? You can place your rule in the logging cycle, this will work.

Here are other more specific properties, that you can use to fine tune your rule:

Protocol.FailureDescription - Holds an error message when a protocol error has occurred, like: ":errno: 104 - 'Connection reset by peer' on socketfd 283:server state 8:state 9:Application response 502 cannotconnect"

Message.TemplateName - Contains the file name for a block message

 

let me know if it works for you.

 

Was my response useful to you? If so, please consider marking it as an Accepted Solution and giving it a Kudo (click on the thumb up symbol) to help other community members. MWG+Splunk=❤

Re: Response.StatusCode is not showing

Hello and thank you for your response,

we want to display to the user a different template page based on the 502 response that is the reason. Can you assist with that?
fw_mon
Reliable Contributor
Reliable Contributor
Report Inappropriate Content
Message 4 of 6

Re: Response.StatusCode is not showing

first try to modify default 502 pages under Policy > Templates >  Default Schema.

You'll find several 502-related block messages:

Proxy: Bad Gateway

Proxy: Cannot Connect

Proxy: Not Resolvable

may be other..

 

Was my response useful to you? If so, please consider marking it as an Accepted Solution and giving it a Kudo (click on the thumb up symbol) to help other community members. MWG+Splunk=❤

Re: Response.StatusCode is not showing

Hello and thank you for your response.

 

If I create a policy and try to read the value of "Response.StatusCode". I receive the value 0. If i see the details of the request i see the value 502.

 

If want to show the user a specific template if it receives the value 502.

fw_mon
Reliable Contributor
Reliable Contributor
Report Inappropriate Content
Message 6 of 6

Re: Response.StatusCode is not showing

Hello @User99518290 

you need modify the before mentioned Proxy error pages that are shown at 502 errors. 

Was my response useful to you? If so, please consider marking it as an Accepted Solution and giving it a Kudo (click on the thumb up symbol) to help other community members. MWG+Splunk=❤
You Deserve an Award
Don't forget, when your helpful posts earn a kudos or get accepted as a solution you can unlock perks and badges. Those aren't the only badges, either. How many can you collect? Click here to learn more.

Community Help Hub

    New to the forums or need help finding your way around the forums? There's a whole hub of community resources to help you.

  • Find Forum FAQs
  • Learn How to Earn Badges
  • Ask for Help
Go to Community Help

Join the Community

    Thousands of customers use our Community for peer-to-peer and expert product support. Enjoy these benefits with a free membership:

  • Get helpful solutions from product experts.
  • Stay connected to product conversations that matter to you.
  • Participate in product groups led by employees.
Join the Community
Join the Community