Error when trying to index to data streamd

I've created an index template + a data stream and tried to bulk create from Go library.

Request is:

{"create":{}}
{"@timestamp":"2022-03-02T12:48:23+03:00","domain_name":"adlook-rev.me","domain_type":"","webmaster_pin":37530221,"device_type":"pc","device_os":"Windows","browser_type":"","country":"IL","city":""}

Error:

{"type":"illegal_argument_exception","reason":"Mapper for [_data_stream_timestamp] conflicts with existing mapper:\\n\\tCannot update parameter [enabled] from [true] to [false]"}"

Sending the same request from the console in Kibana is fine:

What could be the reason for this?

GET _index_templates/inventories
returns this:

{
  "index_templates" : [
    {
      "name" : "inventories",
      "index_template" : {
        "index_patterns" : [
          "inventories"
        ],
        "template" : {
          "settings" : {
            "index" : {
              "lifecycle" : {
                "name" : "inventories-ilm"
              },
              "routing" : {
                "allocation" : {
                  "require" : {
                    "data" : "hot"
                  }
                }
              },
              "sort" : {
                "field" : [
                  "@timestamp"
                ],
                "order" : [
                  "asc"
                ]
              },
              "number_of_replicas" : "0"
            }
          },
          "mappings" : {
            "_routing" : {
              "required" : false
            },
            "dynamic" : false,
            "_source" : {
              "excludes" : [ ],
              "includes" : [ ],
              "enabled" : true
            },
            "dynamic_templates" : [ ],
            "properties" : {
              "country" : {
                "type" : "text",
                "fields" : {
                  "keyword" : {
                    "ignore_above" : 256,
                    "type" : "keyword"
                  }
                }
              },
              "domain_name" : {
                "type" : "text",
                "fields" : {
                  "keyword" : {
                    "ignore_above" : 256,
                    "type" : "keyword"
                  }
                }
              },
              "domain_type" : {
                "type" : "text",
                "fields" : {
                  "keyword" : {
                    "ignore_above" : 256,
                    "type" : "keyword"
                  }
                }
              },
              "@timestamp" : {
                "index" : true,
                "ignore_malformed" : false,
                "store" : false,
                "type" : "date",
                "doc_values" : true
              },
              "city" : {
                "type" : "text",
                "fields" : {
                  "keyword" : {
                    "ignore_above" : 256,
                    "type" : "keyword"
                  }
                }
              },
              "browser_type" : {
                "type" : "text",
                "fields" : {
                  "keyword" : {
                    "ignore_above" : 256,
                    "type" : "keyword"
                  }
                }
              },
              "webmaster_pin" : {
                "type" : "long"
              },
              "device_type" : {
                "type" : "text",
                "fields" : {
                  "keyword" : {
                    "ignore_above" : 256,
                    "type" : "keyword"
                  }
                }
              },
              "device_os" : {
                "type" : "text",
                "fields" : {
                  "keyword" : {
                    "ignore_above" : 256,
                    "type" : "keyword"
                  }
                }
              }
            }
          }
        },
        "composed_of" : [ ],
        "data_stream" : {
          "hidden" : false
        }
      }
    }
  ]
}

GET inventories

{
  ".ds-inventories-2022.03.02-000001" : {
    "aliases" : { },
    "mappings" : {
      "dynamic" : "true",
      "_data_stream_timestamp" : {
        "enabled" : true
      },
      "dynamic_date_formats" : [
        "strict_date_optional_time",
        "yyyy/MM/dd HH:mm:ss Z||yyyy/MM/dd Z"
      ],
      "dynamic_templates" : [ ],
      "date_detection" : true,
      "numeric_detection" : false,
      "properties" : {
        "@timestamp" : {
          "type" : "date"
        },
        "browser_type" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "city" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "country" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "device_os" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "device_type" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "domain_name" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "domain_type" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
        "webmaster_pin" : {
          "type" : "long"
        }
      }
    },
    "settings" : {
      "index" : {
        "lifecycle" : {
          "name" : "inventories-ilm"
        },
        "routing" : {
          "allocation" : {
            "require" : {
              "data" : "hot"
            }
          }
        },
        "hidden" : "true",
        "number_of_shards" : "1",
        "provided_name" : ".ds-inventories-2022.03.02-000001",
        "creation_date" : "1646213499536",
        "sort" : {
          "field" : [
            "@timestamp"
          ],
          "order" : [
            "asc"
          ]
        },
        "priority" : "100",
        "number_of_replicas" : "0",
        "uuid" : "C0DugtUxQnSbOahY56bS9w",
        "version" : {
          "created" : "7140199"
        }
      }
    },
    "data_stream" : "inventories"
  }
}

Seems to be a problem with "_data_stream_timestamp" : {
"enabled" : true
}, but what can I do about it?

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