CloudLogging Policy - Dynamic module

I have created a Sharedflow that contains a CloudLogging policy like described below.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<MessageLogging continueOnError="false" enabled="true" name="ML-CloudLogging">
  <DisplayName>ML-CloudLogging</DisplayName>
  <CloudLogging>
    <LogName>projects/{organization.name}/logs/apigee</LogName>
    <Message contentType="application/json">{
    "verb": "{request.verb}",
    "response_code": "{response.status.code}"
    }</Message>
    <Labels>
      <Label>
        <Key>Proxy</Key>
        <Value>{apiproxy.name}</Value>
      </Label>
      <Label>
        <Key>Environment</Key>
        <Value>{environment.name}</Value>
      </Label>
    </Labels>
  </CloudLogging>
</MessageLogging>
 
The logging works as expected but the value for the label is not extrapolated. 
phertzog_0-1681820705443.png
 

Is there a way to dynamicaly set the value of the label?

Regards

0 2 133
2 REPLIES 2

The Label values are static values that should be defined at the time of deployment and cant be referenced via variables. One way to approach this is within your CICD pipeline to construct the values at the time of preparing the proxy bundle for deployment.

Thanks for the answer.

But your suggestion defeats the idea of having the cloud logging in a shared flow. There is only a generic version deployed. The shared flow is called from several proxies. I wanted to have the proxy name as label in order to make the filtering easier and perhaps more efficient in the log explorer.

Thanks for the confirmation of the static nature of the Labels.

Philippe