- Ruby Client: other versions:
- Overview
- Getting started
- Installation
- Connecting
- Configuration
- Integrations
- Examples
- Troubleshooting
- Client helpers
- Release Notes
- 8.18 Release notes
- 8.17 Release notes
- 8.16 Release notes
- 8.15 Release notes
- 8.14 Release notes
- 8.13 Release notes
- 8.12 Release notes
- 8.11 Release notes
- 8.10 Release notes
- 8.9 Release notes
- 8.8 Release notes
- 8.7 Release notes
- 8.6 Release notes
- 8.5 Release notes
- 8.4 Release notes
- 8.3 Release notes
- 8.2 Release notes
- 8.1 Release notes
- 8.0 Release notes
- 7.17 Release notes
- 7.16 Release notes
- 7.15 Release notes
- 7.14 Release notes
- 7.13 Release notes
- 7.12 Release notes
- 7.11 Release notes
- 7.10 Release notes
- 7.9 Release notes
- 7.8 Release notes
- 7.7 Release notes
- 7.6 Release notes
- 7.5 Release notes
- 7.0 Release notes
IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Elastic Common Schema (ECS)
edit
A newer version is available. Check out the latest documentation.
Elastic Common Schema (ECS)
editThe Elastic Common Schema (ECS) is an open source format that defines a common set of fields to be used when storing event data like logs in Elasticsearch.
You can use the library ecs-logging which is a set of libraries that enables you to transform your application logs to structured logs that comply with the ECS format.
Add this line to your application’s Gemfile:
gem 'ecs-logging'
Then execute bundle install
. Or install from the command line yourself:
$ gem install ecs-logging
Then configure the client to use the logger:
require 'ecs_logging/logger' require 'elasticsearch' logger = EcsLogging::Logger.new($stdout) client = Elasticsearch::Client.new(logger: logger) > client.info {"@timestamp":"2022-07-12T05:31:18.590Z","log.level":"INFO","message":"GET http://localhost:9200/ [status:200, request:0.009s, query:n/a]","ecs.version":"1.4.0"}...
See ECS Logging Ruby Reference for more information on how to configure the logger.
Was this helpful?
Thank you for your feedback.