# v2 - Breaking changes

## Overview

**OpenSearch** has several breaking changes, so you must verify your application compatibility using this link:

{% embed url="<https://opensearch.org/docs/latest/breaking-changes/>" %}

## Remove mapping type

This is the major breaking change and it is not specific to OpenSearch as it was alreay planned by ElasticSearch before the fork

{% embed url="<https://www.elastic.co/guide/en/elasticsearch/reference/7.17/removal-of-types.html>" %}

So you must be sure that your applications are not using anymore the "type" parameters.

Here are some solutions regarding products often use with elastic solutions and how to configure them to work with OpenSearch 2.x

### Fluentbit

{% embed url="<https://docs.fluentbit.io/manual/pipeline/outputs/elasticsearch>" %}

If the client is Fluentbit, the easiest solution is to set the parameter **Suppress\_Type\_Name** to On.

It is also possible to change the output plugin to the opensearch native one which is part of Fluentbit since version 1.9.

{% embed url="<https://docs.fluentbit.io/manual/pipeline/outputs/opensearch>" %}

The following article may prove useful for getting started with Fluentbit and OpenSearch:

{% embed url="<https://opensearch.org/blog/technical/2022/03/getting-started-with-fluent-bit-and-opensearch/>" %}

### Fluentd

If the client is Fluentd it's more tricky. There is also a **suppress\_type\_name** but the plugin is using this parameter only if detect an elastic version>=7.

So we need to add to more parameters:

* **verify\_es\_version\_at\_startup** to false to not let the plugin detect the version
* **default\_elasticsearch\_version** to '7'

{% embed url="<https://github.com/uken/fluent-plugin-elasticsearch>" %}

Here are for exemple the change to be done on the spec of the output plugin we're using in Kubernetes

<details>

<summary>Before</summary>

{% code lineNumbers="true" %}

```yaml
 elasticsearch:
    flatten_hashes: true
    host: ostest.es.cegedim.cloud
    include_tag_key: true
    log_es_400_reason: true
    logstash_format: true
    logstash_prefix: myit-app-prod-frontend
    password:
      valueFrom:
        secretKeyRef:
          key: myit-app-prod_password
          name: it-cloud-eb.es.cegedim.cloud
    port: 443
    prefer_oj_serializer: true
    reconnect_on_error: true
    request_timeout: 30s
    scheme: https
    suppress_type_name: true
    user: myit-app-prod
```

{% endcode %}

</details>

<details>

<summary>After</summary>

{% code lineNumbers="true" %}

```yaml
  elasticsearch:
    default_elasticsearch_version: "7"
    flatten_hashes: true
    host: ostest.es.cegedim.cloud
    include_tag_key: true
    log_es_400_reason: true
    logstash_format: true
    logstash_prefix: myit-app-prod-frontend
    password:
      valueFrom:
        secretKeyRef:
          key: myit-app-prod_password
          name: it-cloud-eb.es.cegedim.cloud
    port: 443
    prefer_oj_serializer: true
    reconnect_on_error: true
    request_timeout: 30s
    scheme: https
    suppress_type_name: true
    user: myit-app-prod
    verify_es_version_at_startup: false
```

{% endcode %}

</details>

There is also an output plugin for OpenSearch.

{% embed url="<https://docs.fluentd.org/output/opensearch>" %}

{% hint style="warning" %}
The OpenSearch Plugin is not yet available in Rancher Logging System
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://academy.cegedim.cloud/databases/opensearch/opensearch-features/v2-breaking-changes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
