Apigee Message Logging Policy | Logging to Splunk from Apigee API proxy

Hi Everyone,

I have a requirement to enable logging on an Apigee API proxy. The logs should be logged to the Splunk server. The issue is that the Splunk server is not receiving the logs. I would appreciate if someone could identify what am I doing wrong and how can I achieve the required functionality?

I am using MessageLogging policy in response flow of PostClient flow of the Apigee API as below:

muq_ash_0-1701065970196.png

The configurations for the policy are as follows:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<MessageLogging continueOnError="false" enabled="true" name="ML-LogToSplunk">
<DisplayName>ML-LogToSplunk</DisplayName>
<Syslog>
<Message>{
"data": "This is a test log from Apigee ML policy"
}</Message>
<HTTP>
<Endpoint>https://{host}:{port}/services/collector/event</Endpoint>
<Format>JSON</Format>
<Headers>
<Header name="Authorization">[HEC Token]</Header>
<Header name="x-splunk-index">[index]</Header>
</Headers>
</HTTP>
</Syslog>
</MessageLogging>

1 0 122
0 REPLIES 0