gpt-4o-2024-08-06· OpenAI
WildChat-4.8M (AI2)
Example json log for Logstash in ECS 1 compatible format (only necessary fields)
- User
Example json log for Logstash in ECS 1 compatible format (only necessary fields)
- Assistant
Certainly! ECS (Elastic Common Schema) is a standardized way to structure log and event data in Elasticsearch. Below is an example JSON log in ECS 1 compatible format with only the necessary fields. This example can be adjusted based on the specific use case and additional fields that might be necessary for your logging needs.
{ "@timestamp": "2023-10-11T13:45:30.000Z", "message": "User login successful", "ecs": { "version": "1.0.0" }, "log": { "level": "info", "logger": "auth-service" }, "host": { "name": "web-server-01" }, "event": { "dataset": "authentication", "severity": 2, "action": "user-login" }, "user": { "id": "1234", "name": "jdoe" }, "source": { "ip": "192.168.1.10" }, "http": { "request": { "method": "POST" }, "response": { "status_code": 200 } } }Explanation of Fields:
- @timestamp: The date and time when the event occurred in ISO 8601 format.
- message: A free-form message describing the log event.
- ecs.version: The version of ECS being used, here it's set to "1.0.0".
- log.level: The severity or level of the log message, such as "info", "error".
- log.logger: The name of the logger or component generating the log.
- host.name: The name of the host from which the log originated.
- event.dataset: The type of events collected, here denoted as "authentication".
- event.severity: A numerical representation of the log level, with lower numbers often indicating less severe events.
- event.action: The specific action or operation reported by the event.
- user.id: Identifier for the user involved in the event.
- user.name: Name of the user involved in the event.
- source.ip: The IP address from which the request originated.
- http.request.method: The HTTP method used in the request.
- http.response.status_code: The status code returned by the HTTP response.
This example provides a basic template following ECS conventions, which can be expanded by including additional fields relevant to your logging needs while maintaining the common structure.