Log Monitoring API v1 has been deprecated with Dynatrace version 1.284. Its replacement is Log Monitoring API. We recommend that you migrate to the new API at your earliest convenience.
The migration affects endpoint URLs, query parameters, and response/request body parameters, as well as the scope of the token for request authentication.
Log Classic API offers you the following new features:
The ingestion of custom events consumes Davis Data Units (DDUs) from the logs pool.
Log Classic API new
/api/v2/logs/aggregate
/api/v2/logs/export
/api/v2/logs/ingest
/api/v2/logs/search
Log Monitoring v1 old
/api/v1/entity/infrastructure/custom-devices
/api/v1/entity/infrastructure/hosts
/api/v1/entity/infrastructure/process-groups
logs.read
)logs.ingest
)LogExport
)To learn about new query/body parameters, see the documentation of individual requests in Log Classic API.
Here are some examples of differences in API usage.
GET "https://mySampleEnv.live.dynatrace.com/api/v2/logs/aggregate?from=now-7d&to=now&query=dt.entity.process_group%20%3D%20%22process_group-09875e82e2fb98fd%22&timeBuckets=1&maxGroupValues=10&groupBy=log.source"
or
GET "'https://mySampleEnv.live.dynatrace.com/api/v2/logs/aggregate?from=now-7d&to=now&query=dt.process.name%3D%22windows%20system%22&timeBuckets=1&maxGroupValues=10&groupBy=log.source'"
{"aggregationResult": {"log.source": {"1705331381355": {"windows security log": 44,"windows application log": 10}}}}
GET 'https://mySampleEnv.live.dynatrace.com/api/v2/logs/search?from=now-6h&to=now&limit=1000&query=dt.entity.process_group%3D%22process_group-944a2cee87e6e3aa%22&sort=-timestamp'
{"results": [{"timestamp": 1705667987673,"content": "<![LOG[Non-AppUsage event got through, ignore this event.]LOG]!><time=\"13:38:30.0161567\" date=\"1-19-2024\" component=\"SensorFramework\" context=\"\" type=\"1\" thread=\"14\" file=\"\">","status": "NONE","eventType": "LOG","additionalColumns": {"loglevel": ["NONE"],"dt.entity.process_group": ["PROCESS_GROUP-944A2CEE87E6E3AA"],"dt.source_entity": ["PROCESS_GROUP_INSTANCE-C27914355E744AA8"],"process.technology": [".NET","CLR"],"dt.process.name": ["Microsoft.Management.Services.IntuneWindowsAgent.exe"],"dt.entity.process_group_instance": ["PROCESS_GROUP_INSTANCE-C27914355E744AA8"],"log.source": ["C:\\ProgramData\\Microsoft\\IntuneManagementExtension\\Logs\\Sensor.log"],"host.name": ["CT-XYZ1234"],"dt.entity.host": ["HOST-23606F6C8433070B"]}},]}
GET "https://mySampleEnv.live.dynatrace.com/api/v2/logs/aggregate?from=now-7d&to=now&query=log.source%3D%22c%3A%5C%5Cprogramdata%5C%5Cmicrosoft%5C%5Cintunemanagementextension%5C%5Clogs%5C%5Chealthscripts.log%22%20AND%20dt.process.name%3D%22microsoft.management.services.intunewindowsagent.exe%22&timeBuckets=1&maxGroupValues=10"
{"aggregationResult": {"dt.entity.process_group": {"1705336941514": {"process_group-944a2cee87e6e3aa": 1237}},"dt.source_entity": {"1705336941514": {"process_group_instance-c27914355e744aa8": 1237}},"process.technology": {"1705336941514": {".net": 1237,"clr": 1237}},"dt.process.name": {"1705336941514": {"microsoft.management.services.intunewindowsagent.exe": 1237}},"loglevel": {"1705336941514": {"none": 1231,"error": 3,"info": 3}},"event.type": {"1705336941514": {"log": 1237}},"dt.entity.process_group_instance": {"1705336941514": {"process_group_instance-c27914355e744aa8": 1237}},"log.source": {"1705336941514": {"c:\\programdata\\microsoft\\intunemanagementextension\\logs\\healthscripts.log": 1237}},"host.name": {"1705336941514": {"my-host": 1237}},"status": {"1705336941514": {"none": 1231,"error": 3,"info": 3}},"dt.entity.host": {"1705336941514": {"host-23606f6c8433070b": 1237}}}}