# Create an index in command line with scripted\_fields

**URL:** <https://discuss.elastic.co/t/create-an-index-in-command-line-with-scripted-fields/56704>\
**Category:** Elasticsearch\
**Created:** [July 29, 2016, 7:18am UTC](https://discuss.elastic.co/t/create-an-index-in-command-line-with-scripted-fields/56704 "2016-07-29T07:18:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pittoch](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@pittoch](https://discuss.elastic.co/u/pittoch)\
**Post date:** [July 29, 2016, 7:18am UTC](https://discuss.elastic.co/t/create-an-index-in-command-line-with-scripted-fields/56704/1 "2016-07-29T07:18:31Z")

</div>

Hi,

1: I try to create an index in command line with succes without scripted fields

```
PUT /my_index_test
{
"settings" : {
        "number_of_shards" : 1
  },
 "mappings": {
      "core2": {
        "properties": {
          "@timestamp": {
            "type": "date",
            "format": "strict_date_optional_time||epoch_millis"
          },
          "@version": {
            "type": "string"
          },
          "Available_Capacity_%": {
            "type": "double"
          },
          "Available_Capacity_gb": {
            "type": "double"
          },
          "BATIMENT": {
            "type": "string"
          },
          "CENTERA": {
            "type": "string"
          },
          "DATE": {
            "type": "string"
          },
          "DATEXM": {
            "type": "string"
          },
          "Free_Object_Count_%": {
            "type": "double"
          },
          "Free_Object_Count_nb": {
            "type": "double"
          },
          "Free_Raw_Capacity_%": {
            "type": "double"
          },
          "Free_Raw_Capacity_gb": {
            "type": "double"
          },
          "MONDE": {
            "type": "string"
          },
          "Name": {
            "type": "string"
          },
          "ROLE": {
            "type": "string"
          },
          "prediction": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        }
      }
    }
}

```

Now I try to add the scripted\_fields, I try to add this line before the mapping section, but without success

```
  "script_fields" : {
  
  	"UsedRawLimit": {
  		"script" : "0.8"
  	},
  
  	"UsedObjectLimit": {
  		"script" : "0.8"
  	}
 },

```

I don't have error

```
{
  "acknowledged": true
}

```

but, when I go in Settings\>Indices web page of Kibana, I create the new indice, and scripted\_fields don't appears.  
How can I do that ?

2: For some reason, I need to change the format of a "Type". For example:

 ![](https://us1.discourse-cdn.com/elastic/original/2X/3/3b64b7372ceb83c03c5e139cf2f5f461775c34f5.png)  
How can I custumize it in command line ?

Thanks!

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [July 29, 2016, 12:32pm UTC](https://discuss.elastic.co/t/create-an-index-in-command-line-with-scripted-fields/56704/2 "2016-07-29T12:32:23Z")

</div>

I believe scripted fields are part of a search request, not part of the mapping. I expect the trouble is just that the parsing isn't strict there and doesn't notice that you sent it a field it can't interpret.

I wonder if this is actually a better question for the kibana board though, because it seems like your actual goal is to make kibana do something. Maybe ask in that board?

---

<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 5, 2017, 10:31pm UTC](https://discuss.elastic.co/t/create-an-index-in-command-line-with-scripted-fields/56704/3 "2017-07-05T22:31:44Z")

</div>


