spikearrest.xxx.failed does not get set

Not applicable

I have two spike arrest policies in my proxy. I use the following code to separate them:

<FaultRule name="spike_arrest">
    <Step>
        <Name>fault_spike_arrest</Name>
        <Condition>spikearrest.spike_protection.failed = "true"</Condition>
    </Step>
    <Step>
        <Name>fault_revalidate_spike_arrest</Name>
        <Condition>(spikearrest.revalidate_spike_protection.failed = "true")</Condition>
    </Step>
    <Condition>(fault.name = "SpikeArrestViolation")</Condition>
</FaultRule>

I've logged the values of fault.name and it is correct. The value of at least spikearrest.revalidate_spike_protection.failed, however, never gets set. AFAIK this is the correct form of the variable name to check this condition. Is the form of the name for SpikeArrest polciies different?

0 2 332
2 REPLIES 2

Not applicable

Well, I made a guess based on the documented other variables, and it looks like rather than

spikearrest.revalidate_spike_protection.failed

it needs to be

ratelimit.revalidate_spike_protection.failed

It looks like, based on the available flow variable names documented, that Quota policy and SpikeArrest policy are grouped together, and don't follow the pattern.

Not applicable
@George Shaw

The condition you want to add is "<Condition>(fault.name = "SpikeArrestViolation")</Condition>"

You get this error code today from the spike arrest policy itself and you can further customize the response using the above condition. This is also documented in the error codes section of the policy - http://docs.apigee.com/api-services/reference/spike-arrest-policy

I hope this helps!

-Vinit