# Logstash Opensearch Configuration havin codec json

**URL:** <https://discuss.elastic.co/t/logstash-opensearch-configuration-havin-codec-json/330607>\
**Category:** Logstash\
**Created:** [April 24, 2023, 7:20am UTC](https://discuss.elastic.co/t/logstash-opensearch-configuration-havin-codec-json/330607 "2023-04-24T07:20:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![djrshn2346](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/djrshn2346/32/108594_2.png) [@djrshn2346](https://discuss.elastic.co/u/djrshn2346)\
**Post date:** [April 24, 2023, 7:20am UTC](https://discuss.elastic.co/t/logstash-opensearch-configuration-havin-codec-json/330607/1 "2023-04-24T07:20:53Z")

</div>

I am using opensearch with logstash, I wanted to use `codec => json` in output section of opensearch configuration. How can I achieve that?

```auto
opensearch {
        hosts => ["${OPENSEARCH_HOSTS}"]
        index => "%{logplane}-%{+{{ $date_format }}}"
        http_compression => true
        {{- if $g.security.tls.enabled }}
        ssl => true
        cacert => "/run/secrets/sip-tls-trusted-root-cert/ca.crt"
        keystore => "/opt/logstash/resource/keystore.p12"
        keystore_password => "%%KEYSTORE_PASS%%"
        ssl_certificate_verification => true
        {{- end }}
        manage_template => false
      }

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 24, 2023, 7:20am UTC](https://discuss.elastic.co/t/logstash-opensearch-configuration-havin-codec-json/330607/2 "2023-04-24T07:20:53Z")

</div>

OpenSearch/OpenDistro are AWS run products and differ from the original Elasticsearch and Kibana products that Elastic builds and maintains. You may need to contact them directly for further assistance.

(This is an automated response from your friendly Elastic bot. Please report this post if you have any suggestions or concerns :elasticheart: )

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [April 24, 2023, 12:17pm UTC](https://discuss.elastic.co/t/logstash-opensearch-configuration-havin-codec-json/330607/3 "2023-04-24T12:17:04Z")

</div>

> [@djrshn2346](#):
>
> I am using opensearch with logstash, I wanted to use `codec => json` in output section of opensearch configuration. How can I achieve that?

Opensearch is not supported here, you need to check on an Opensearch forum.

But if the Opensearch output is similar to the Elasticsearch output, then there is no option to change the codec as the codec needs to be and already is `json`.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 22, 2023, 12:17pm UTC](https://discuss.elastic.co/t/logstash-opensearch-configuration-havin-codec-json/330607/4 "2023-05-22T12:17:52Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
