Elastic Logging Plugin usage examples
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
The following examples show common configurations for the Elastic Logging Plugin.
Docker run command:
docker run --log-driver=elastic/elastic-logging-plugin:9.5.6 \
--log-opt hosts="myhost:9200" \
--log-opt user="myusername" \
--log-opt password="mypassword" \
-it debian:jessie /bin/bash
Daemon configuration:
{
"log-driver" : "elastic/elastic-logging-plugin:9.5.6",
"log-opts" : {
"hosts" : "myhost:9200",
"user" : "myusername",
"password" : "mypassword",
}
}
Docker run command:
docker run --log-driver=elastic/elastic-logging-plugin:9.5.6 \
--log-opt cloud_id="MyElasticStack:daMbY2VudHJhbDekZ2NwLmN4b3VkLmVzLmliJDVkYmQwtGJiYjs0NTRiN4Q5ODJmNGUwm1IxZmFkNjM5JDFiNjdkMDE4MTgxMTQzNTM5ZGFiYWJjZmY0OWIyYWE5" \
--log-opt cloud_auth="myusername:mypassword" \
-it debian:jessie /bin/bash
Daemon configuration:
{
"log-driver" : "elastic/elastic-logging-plugin:9.5.6",
"log-opts" : {
"cloud_id" : "MyElasticStack:daMbY2VudHJhbDekZ2NwLmN4b3VkLmVzLmliJDVkYmQwtGJiYjs0NTRiN4Q5ODJmNGUwm1IxZmFkNjM5JDFiNjdkMDE4MTgxMTQzNTM5ZGFiYWJjZmY0OWIyYWE5",
"cloud_auth" : "myusername:mypassword",
"output.elasticsearch.index" : "elastic-log-driver-%{+yyyy.MM.dd}"
}
}
Docker run command:
docker run --log-driver=elastic/elastic-logging-plugin:9.5.6 \
--log-opt hosts="myhost:9200" \
--log-opt user="myusername" \
--log-opt password="mypassword" \
--log-opt index="eld-%{[agent.version]}-%{+yyyy.MM.dd}" \
-it debian:jessie /bin/bash
Daemon configuration:
{
"log-driver" : "elastic/elastic-logging-plugin:9.5.6",
"log-opts" : {
"hosts" : "myhost:9200",
"user" : "myusername",
"index" : "eld-%{[agent.version]}-%{+yyyy.MM.dd}",
"password" : "mypassword",
}
}