conditional flow for matching environments & executing the Message Logging policy

Hi @dchiesa1 @kurtkanaskie , we are trying do message logging based on environments like any prod/pilot related (prod1, prod2, prod3, prodext1, prodext2 ,pilot1, pilot2 etc) in prod apigeex org to be sent to prod splunk versus all other nonProd environments like dev1/dev2/dev3/qa1/qa2/qa3/perf1/perf2/perf3/uat1/uat2/uat3/qaetx1/qaext2 etc  in nonprod apigeex org to a nonprod splunk one. We wrote the conditions as below in shared flow as below & doesnt seem to work properly. Is there a better way to write the conditions to handle environments & future growth of the environments in numeric order.

<SharedFlow name="default">
<Step>
<Name>ML-Test</Name>
<Condition>(environment.name != "prod1") or or (environment.name != "prod2") or (environment.name != "prodext1" or (environment.name != "pilot1")</Condition>
</Step>
<Step>
<Name>ML-Prod</Name>
<Condition>(environment.name = "prod1") or (environment.name = "prod2") or (environment.name = "prodext1") or (environment.name = "pilot1)"</Condition>
</Step>
</SharedFlow>

Solved Solved
2 1 49
1 ACCEPTED SOLUTION

You can use the "Matches" operator as per: https://cloud.google.com/apigee/docs/api-platform/fundamentals/flow-variables-and-conditions#pattern...

<Condition>(environment.name Matches "prod*")</Condition>

View solution in original post

1 REPLY 1

You can use the "Matches" operator as per: https://cloud.google.com/apigee/docs/api-platform/fundamentals/flow-variables-and-conditions#pattern...

<Condition>(environment.name Matches "prod*")</Condition>