Hi guys,
I would like to get the Temporal server logs (history, frontend, matching and worker) in ECS format ( ECS logging libraries | ECS logging libraries ). But what it seems is that the default Temporal log in Json has it’s own format and it is not possible to configure it.
What I found was this config with “json” but it does not provide ECS format.
How could I implement this?
Would this be supported? If not how can I request support for it?
Thank you.
Hi, from our convo in Temporal Slack:
Your correct in that server supports
format: json - this is temporals own zap json schema
or
format: console
in static config
There is no out of box support for ecs format but you can set it up if you build your custom server image, see example here
and look at how code builds ecs logger and then uses it when creating server:
temporal.WithLogger(logger),
If you want tto try out that repo to see ecs format in server logs, set
TEMPORAL_LOG_FORMAT=ecs
for all temporal services in the compose file and follow readme how to build and run locally .
If you cant or dont wanna build custom image then maybe look at reformatting temporal json log format to what you need in es ingest pipeline
Guess rewrite rules like this could work:
{ "rename": { "field": "ts", "target_field": "@timestamp" } },
{ "rename": { "field": "level", "target_field": "log.level" } },
{ "rename": { "field": "msg", "target_field": "message" } }
For your follow up question if this is somethign that could be added as default in server, yeah you can create a github issue and see what server team says. Hope this helps.