Logstash Opensearch Configuration havin codec json

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):

1.2.0

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

Configuration:

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
      }

Relevant Logs or Screenshots:

You shouldn’t have to use or specify the json codec output if using the opensearch output plugin, however if you want to print to stdout you can use the codec => json parameter.
Output plugins | Logstash Reference [8.7] | Elastic - would be the best place to find out which plugins you can use different codecs on.