What software ihandles shipping to ElasticSearch the standard output of a .NET Core web application running in a container?
How do I send a structured message?

If you want structured messages check out some of the recommended third party logging options.  Some of these options have built-in support for Elasticsearch logging.  For instance, Serilog provides a "sink" for putting logs directly into Elasticsearch.

How do I configure it in code?

These options all tie into the ILogger interface, so testing different logging frameworks should require very little code changes.  However, the initial entry point of the application (e.g. Program.cs) will need to be configured to use the 3rd party logger.  The official .net core docs go over this in detail.

How do I configure it for Elasticsearch?

This will depend on the logger.  The appsettings.json will most likely be where you configure the .net core application's connection to Elasticsearch.