Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

message logging using KVM approach

Hi,

Need a suggestion with better approach instead of using KVM and also create new line in the splunk for all the requests .

For logging mechanism , I used message logging policy and I created a variable in the message tag, that variable pulling the data from the KVM.

The reason I used KVM,

1- Development team can add/update the variables in the log

2- Create a new line in the splunk for all the requests

Logging policy:

<Message>{logTemplate}</Message>

requestLogTemplate in KVM: {"apiproxyName":"{apiproxy.name}";"clientReceivedStartTime":"{client.received.start.time}";"clientEndTime":"{system.time}";"queryParam":"{request.querystring}"}

Created a JS policy to retrieve requestLogTemplate from KVM and create new line.

logTemplate = logTemplate+ '\n';

1 1 469
1 REPLY 1