# Error Provisioning Index Pattern

**URL:** https://discuss.elastic.co/t/error-provisioning-index-pattern/276172
**Category:** Kibana
**Created:** [June 16, 2021, 5:15pm UTC](https://discuss.elastic.co/t/error-provisioning-index-pattern/276172 "2021-06-16T17:15:54Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![dawiro](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dawiro](https://discuss.elastic.co/u/dawiro)
#### Post date: [June 16, 2021, 5:15pm UTC](https://discuss.elastic.co/t/error-provisioning-index-pattern/276172/1 "2021-06-16T17:15:54Z")

</div>

Hi,  
I'm trying to create an index pattern from the following json file:

```auto
{
  "index_pattern": {
    "id": "<pattern_id>"
    "version": "0.1"
    "title": "test-*",
    "timeFieldName": "@timestamp",
    "fieldFormats": {},
    "fieldAttrs": {},
    "allowNoIndex": true
  }
}

```

However, when I apply this file I get the following error:

```auto
{"statusCode":400,"error":"Bad Request","message":"[request body.index_pattern.title]: expected value of type [string] but got [undefined]"}

```

What am I doing wrong here? Kibana version is 7.11.2.

Thx  
D

---

<div class="post-metadata">

### Author: ![lukeelmers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukeelmers/32/35230_2.png) [@lukeelmers](https://discuss.elastic.co/u/lukeelmers)
#### Post date: [June 16, 2021, 5:30pm UTC](https://discuss.elastic.co/t/error-provisioning-index-pattern/276172/2 "2021-06-16T17:30:19Z")

</div>

Your json looks malformed as it's missing a few commas -- is that just from you copying the json over here? If not, I'd start by fixing that.

---

<div class="post-metadata">

### Author: ![dawiro](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dawiro](https://discuss.elastic.co/u/dawiro)
#### Post date: [June 17, 2021, 7:05am UTC](https://discuss.elastic.co/t/error-provisioning-index-pattern/276172/3 "2021-06-17T07:05:57Z")

</div>

Ah, my bad. I should have noticed that! Thanks anyway 🙂

---

<div class="post-metadata">

### Author: ![dawiro](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dawiro](https://discuss.elastic.co/u/dawiro)
#### Post date: [June 17, 2021, 2:02pm UTC](https://discuss.elastic.co/t/error-provisioning-index-pattern/276172/4 "2021-06-17T14:02:34Z")

</div>

I spoke too soon it seems. Adding commas to the end of the json didn't fix the issue.

If I take an example from the documentation page for index pattern provisioning:

```auto
{
  "override": false,
  "refresh_fields": true,
  "index_pattern": {
     "title": "hello"
  }
}

```

I still get the same error:

```auto
{"statusCode":400,"error":"Bad Request","message":"[request body.index_pattern.title]: expected value of type [string] but got [undefined]"}

```

---

<div class="post-metadata">

### Author: ![lukeelmers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukeelmers/32/35230_2.png) [@lukeelmers](https://discuss.elastic.co/u/lukeelmers)
#### Post date: [June 17, 2021, 10:39pm UTC](https://discuss.elastic.co/t/error-provisioning-index-pattern/276172/5 "2021-06-17T22:39:41Z")

</div>

Hm, I just tested this on a 7.11.2 deployment and I can't reproduce it. What does your request look like?

Here's the curl I am using:

```auto
curl -v -X POST "https://my-kibana:9243/api/index_patterns/index_pattern" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -H '<AUTH HEADER OR COOKIE>' -d'
{
  "override": false,
  "refresh_fields": true,
  "index_pattern": {
     "title": "hello"
  }
}
'

```

And I get a 200 back.

---

<div class="post-metadata">

### Author: ![dawiro](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@dawiro](https://discuss.elastic.co/u/dawiro)
#### Post date: [June 18, 2021, 7:12am UTC](https://discuss.elastic.co/t/error-provisioning-index-pattern/276172/6 "2021-06-18T07:12:15Z")

</div>

My request looks like this:

```auto
curl -s -k -H "kbn-xsrf: true" -XPOST http://localhost:5601/api/index_patterns/index_pattern --data @test.json

```

---

<div class="post-metadata">

### Author: ![lukeelmers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukeelmers/32/35230_2.png) [@lukeelmers](https://discuss.elastic.co/u/lukeelmers)
#### Post date: [June 22, 2021, 6:42pm UTC](https://discuss.elastic.co/t/error-provisioning-index-pattern/276172/7 "2021-06-22T18:42:03Z")

</div>

And you are certain the json is not malformed? Does it work if you include the data inline (as in my example above)?

You might also try sending a `Content-Type: application/json` header.

---

<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: [July 20, 2021, 6:42pm UTC](https://discuss.elastic.co/t/error-provisioning-index-pattern/276172/8 "2021-07-20T18:42:26Z")

</div>

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