Change the output codec
Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud. Availability This functionality is generally available and ready for production usage. Serverless interfaces and procedures might differ from classic Elastic Stack deployments. The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability This functionality is generally available and ready for production usage. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.
Serverless
Generally available
Stack
Generally available
For outputs that do not require a specific encoding, you can change the encoding by using the codec configuration. You can specify either the json or format codec. By default the json codec is used.
json.pretty: If pretty is set to true, events will be nicely formatted. The default is false.
json.escape_html: If escape_html is set to true, html symbols will be escaped in strings. The default is false.
Example configuration that uses the json codec with pretty printing enabled to write events to the console:
output.console:
codec.json:
pretty: true
escape_html: false
format.string: Configurable format string used to create a custom formatted message.
Example configurable that uses the format codec to print the events timestamp and message field to console:
output.console:
codec.format:
string: '%{[@timestamp]} %{[message]}'