How Can I post the response of my API proxy into another service using Service callout policy?

Not applicable

Hi Team,

I am connecting Apigee with splunk by using the following link.

https://community.apigee.com/articles/13298/log-messages-into-splunk.html

For that I created a service callout policy with the following code

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ServiceCallout async="false" continueOnError="false" enabled="true" name="Log-to-Splunk">
<DisplayName>Log to Splunk</DisplayName>
<Properties/>
<Request clearPayload="true" variable="myRequest">
<IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
<Set>
<Headers>
<Header name="Authorization">Splunk PUT-SPLUNK-CODE_HERE</Header>
</Headers>
<Payload contentType="application/json" variablePrefix="@" variableSuffix="#">
{"event":"Logged from EDGE"}
</Payload>
<Path>services/collector/event</Path>
<Verb>POST</Verb>
</Set>
</Request>
<Response>calloutResponse</Response>
<HTTPTargetConnection>
<Properties/>
<URL>https://52.23.227.40:8088/</URL>
</HTTPTargetConnection>
</ServiceCallout>

But here we mention the static message in <payload>

How should I get the response of my proxy as the output and post that response into splunk.

Please let me know

0 1 171
1 REPLY 1

HI @A.Anu Manasa

The response.content variable should have the response payload. You can use that variable in your SC