Cannot write logs directly to ElasticSearch using NLog

Hi everyone, I have the following problem. I am trying to write logs to ElasticSearch without using the orchestrator. I have configured the NLog.config file according to the instructions for Elastic Search Target.

<?xml version="1.0" encoding="utf-8" ?>
<!-- XSD manual extracted from package NLog.Schema: https://www.nuget.org/packages/NLog.Schema-->
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xsi:schemaLocation="NLog NLog.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      autoReload="true"
      internalLogFile="c:\temp\console-example-internal.log"
      internalLogLevel="Info" >
	<extensions>
		<add assembly="NLog.Targets.ElasticSearch" assemblyFile="NLog.Targets.ElasticSearch.dll" />
	</extensions>
	<targets>
		<target name="elastic" xsi:type="BufferingWrapper" flushTimeout="5000">
			<target 
				xsi:type="ElasticSearch" 
				uri="https://X.X.X.X:9200/"
			/>
		</target>
	</targets>
	<rules>
		<logger name="*" minlevel="Info" writeTo="elastic" />
	</rules>
</nlog>

I have network access from my PC. I have tried sending logs through Visual Studio 2022 - everything works with the same NLog.Config. After running the robot in UiPath Studio I see the following error.

2024-01-19 14:52:15.4658 Info Validating config: TargetNames=elastic, ConfigItems=23, FilePath=C:\Users\sergey.sysoev\AppData\Local\Programs\UiPath\Studio\NLog.config
2024-01-19 14:52:20.7690 Error ElasticSearch: Failed to send log messages. Status= Uri=https://X.X.X.X:9200/_bulk DebugInformation=Invalid NEST response built from a unsuccessful () low level call on POST: /_bulk
# Invalid Bulk items:
# Audit trail of this API call:
 - [1] PingFailure: Node: https://X.X.X.X:9200/ Exception: ArgumentOutOfRangeException Took: 00:00:00.0290847
# OriginalException: Elasticsearch.Net.ElasticsearchClientException: Failed to ping the specified node. Call: unknown resource
 ---> Elasticsearch.Net.PipelineException: Failed to ping the specified node.
 ---> System.ArgumentOutOfRangeException: The specified value must be greater than 0. (Parameter 'value')
Actual value was -1.
   at System.Net.HttpWebRequest.GetResponse()
   at Elasticsearch.Net.HttpWebRequestConnection.Request[TResponse](RequestData requestData) in E:\Projects\Elastic\elasticsearch-net-copy\src\Elasticsearch.Net\Connection\HttpWebRequestConnection.cs:line 76
   at Elasticsearch.Net.RequestPipeline.Ping(Node node) in E:\Projects\Elastic\elasticsearch-net-copy\src\Elasticsearch.Net\Transport\Pipeline\RequestPipeline.cs:line 383
   --- End of inner exception stack trace ---
   at Elasticsearch.Net.RequestPipeline.Ping(Node node) in E:\Projects\Elastic\elasticsearch-net-copy\src\Elasticsearch.Net\Transport\Pipeline\RequestPipeline.cs:line 396
   at Elasticsearch.Net.Transport`1.Ping(IRequestPipeline pipeline, Node node) in E:\Projects\Elastic\elasticsearch-net-copy\src\Elasticsearch.Net\Transport\Transport.cs:line 236
   at Elasticsearch.Net.Transport`1.Request[TResponse](HttpMethod method, String path, PostData data, IRequestParameters requestParameters) in E:\Projects\Elastic\elasticsearch-net-copy\src\Elasticsearch.Net\Transport\Transport.cs:line 76
   --- End of inner exception stack trace ---
# Audit exception in step 1 PingFailure:
System.ArgumentOutOfRangeException: The specified value must be greater than 0. (Parameter 'value')
Actual value was -1.
   at System.Net.HttpWebRequest.GetResponse()
   at Elasticsearch.Net.HttpWebRequestConnection.Request[TResponse](RequestData requestData) in E:\Projects\Elastic\elasticsearch-net-copy\src\Elasticsearch.Net\Connection\HttpWebRequestConnection.cs:line 76
   at Elasticsearch.Net.RequestPipeline.Ping(Node node) in E:\Projects\Elastic\elasticsearch-net-copy\src\Elasticsearch.Net\Transport\Pipeline\RequestPipeline.cs:line 383
# Request:
<Request stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.>
# Response:
<Response stream not captured or already read to completion by serializer. Set DisableDirectStreaming() on ConnectionSettings to force it to be set on the response.>
 Exception: Elasticsearch.Net.ElasticsearchClientException: Failed to ping the specified node. Call: unknown resource
 ---> Elasticsearch.Net.PipelineException: Failed to ping the specified node.
 ---> System.ArgumentOutOfRangeException: The specified value must be greater than 0. (Parameter 'value')
Actual value was -1.
   at System.Net.HttpWebRequest.GetResponse()
   at Elasticsearch.Net.HttpWebRequestConnection.Request[TResponse](RequestData requestData) in E:\Projects\Elastic\elasticsearch-net-copy\src\Elasticsearch.Net\Connection\HttpWebRequestConnection.cs:line 76
   at Elasticsearch.Net.RequestPipeline.Ping(Node node) in E:\Projects\Elastic\elasticsearch-net-copy\src\Elasticsearch.Net\Transport\Pipeline\RequestPipeline.cs:line 383
   --- End of inner exception stack trace ---
   at Elasticsearch.Net.RequestPipeline.Ping(Node node) in E:\Projects\Elastic\elasticsearch-net-copy\src\Elasticsearch.Net\Transport\Pipeline\RequestPipeline.cs:line 396
   at Elasticsearch.Net.Transport`1.Ping(IRequestPipeline pipeline, Node node) in E:\Projects\Elastic\elasticsearch-net-copy\src\Elasticsearch.Net\Transport\Transport.cs:line 236
   at Elasticsearch.Net.Transport`1.Request[TResponse](HttpMethod method, String path, PostData data, IRequestParameters requestParameters) in E:\Projects\Elastic\elasticsearch-net-copy\src\Elasticsearch.Net\Transport\Transport.cs:line 76
   --- End of inner exception stack trace ---