I am in the process of sending my API logs from MuleSoft CloudHub to Datadog. I am able to send the logs by making the necessary changes to the application’s log4j2.xml. We have several MuleSoft environments like DEV, TEST, UAT and Prod. I don’t want to send the logs from all environments to Datadog and would like to limit to only UAT and Prod. Where can I do that filtering? Is there any specific query parameter for the datadog intake url (https://http-intake.logs.datadoghq.eu/api/v2/logs) where I can specify if the logs need to be sent for an environment or not?
For example, using the below Datadog API, I can send the logs.
curl --location 'https://http-intake.logs.datadoghq.eu/api/v2/logs?host=localhost&ddsource=Mulesoft&service=TestApp&ddtags=test'
--header 'DD-API-KEY: a37607ff-112a-4dde-b4b3-ded433f2e2c3'
--header 'Content-Type: application/json'
--data '{
"Test1": "Test-08JUL24"
}'
I did see this: Is there a way to disable datadog’s log collection for a development environment?, but haven’t succeeded yet