Skip to content

Logging changes to support Beats Elasticsearch module (including logging to JSON) #32850

@jasontedor

Description

@jasontedor

This relates to the effort in Beats (filebeat) to build a module for Elasticsearch. To support this effort, we want to make some changes to the logs in Elasticsearch including removing some existing pain points. The main highlight of these changes will be shipping with JSON logging.

  • Change the name of the main log file to something like server.log. Today the main log file is <clustername>.log and this creates complexity for Filebeat; it would be simpler for them if they could rely on an include pattern based on a predictable log file name (another possibility here is server-<clustername>.log). Note that this will be a breaking change.
  • Each log line should contain the node ID and cluster ID (machine friendly, and serve as unique identifiers), and node name and cluster name (human friendly). Filebeat wants to see these for instances where logs are being collected to a single sink from multiple nodes and multiple clusters.
  • Improve logging in the official Docker images. Logging in Docker images traditionally goes to standard output and standard error. We do this with our official Docker images today, but then there is no way to distinguish the server logs from the audit, deprecation, and slow logs. With a single output stream, we need to add a "type" field to the log outputs from the Docker container so the different sources can be parsed from the single standard output stream.
  • Enable JSON layout. Today we do not support layout, mainly due to security manager issues. We need to address these. With this effort, we want the logs to remain human friendly, so we will also want to define an ordering of the first few fields in the JSON object (something like timestamp, log_level, component, node_name, index_name, shard_id, message).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions