Nlog Target for Opensearch

133 views Asked by At

Is there any official Nlog Target Which supports AWS OpenSearch for Dotnet framework project? Since OpenSearch is forked out of ElasticSearch, Does NLog.Targets.ElasticSearch supports OpenSearch?

Since there is no target for OpenSearch, I tried connecting Opensearch with NLog.Targets.ElasticSearch. But it did not work.

A library from thirdparty NLog.Targets.OpenSearch by TTYLeaf was able to log opensearch dashboard but did not maintain proper JSON format.

The target That I used:

`<add assembly="NLog.Targets.OpenSearch"/>
<target name="openSearch" xsi:type="OpenSearch" 
      uri="***"
      index="***"
      username="***"
      password="***">
  <layout xsi:type="JsonLayout">
    <attribute name="time" layout="${longdate}" />
    <attribute name="level" layout="${level}" />
    <attribute name="data" encode="false" >
      <layout xsi:type='JsonLayout' includeAllProperties="true" maxRecursionLimit="10" />
    </attribute>
  </layout>
</target>
<logger name="opensearch" minlevel="Info" writeTo="openSearch" />`

The below layout also did not maintain proper JSON format.

0

There are 0 answers