apm-server
apm-server copied to clipboard
Add fields from ECS logging spec to log support in v2 intake API
One complication is that the properties might be specified as dotted keys, such as "log.level".
Example ecs log line:
{"@timestamp":"2019-08-06T12:09:12.375Z", "log.level": "INFO", "message":"Tomcat started on port(s): 8080 (http) with context path ''", "service.name":"spring-petclinic","process.thread.name":"restartedMain","log.logger":"org.springframework.boot.web.embedded.tomcat.TomcatWebServer"}
If we specify in the json schema that log is an object, we might ignore the "log.level" field.
So we'll need to expand dots before passing onto the JSON decoding and validation.
@lahsivjar please let the apm-agents developers know once this is merged.
Tested with BC2. Works well overall, but I found a few issues:
- Intake accepts
dataset, should beevent.datasetaccording to the ECS logging spec: https://github.com/elastic/ecs-logging/blob/main/spec/spec.json#L97 - The
error.grouping_keyis being added (by the error grouping key model processor) to application logs witherror.*fields. I think this should only be done for error events. - The
app_logsdata stream is missing field definitions for:error.stack_trace,event.dataset,log.logger,log.origin.file.line,log.origin.file.name,log.origin.function, andprocess.thread.name
Opened https://github.com/elastic/apm-server/issues/9666