# Issue with setting geo shape array

**URL:** https://discuss.elastic.co/t/issue-with-setting-geo-shape-array/232081
**Category:** Logstash
**Created:** [May 11, 2020, 5:32pm UTC](https://discuss.elastic.co/t/issue-with-setting-geo-shape-array/232081 "2020-05-11T17:32:40Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![adude946](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@adude946](https://discuss.elastic.co/u/adude946)
#### Post date: [May 11, 2020, 5:32pm UTC](https://discuss.elastic.co/t/issue-with-setting-geo-shape-array/232081/1 "2020-05-11T17:32:40Z")

</div>

I'm trying to set the envelope geo shape, but cant get the array of array right. It should be: [[a,b],[c,d]]. I know the syntax is wrong but not sure what to change. Tried both ways using ruby and mutate.

**Error**  
"Failed to build [geojson] after last required field arrived","caused\_by":{"type":"null\_pointer\_exception"}

```
mutate {
    add_field => {
      "[geo][geobound][type]" => "envelope"          
      "[geo][geobound][coordinates]" => [["%{[geo][minlon]}","%{[geo[maxlat]}"], ["%{[geo][maxlon]}","%{[geo][minlat]}"]]
    }}

```

**output**

```
  "geo" => {
        "geobound" => {
              " type" => "envelope",
        "coordinates" => [
            [0] 0.0,
            [1] 0.0
        ]
    }
}

```

Using ruby (if i use the outer brackets like [[a,b],[c,d]] then its erroring as a code format issue. so tried it without the outer bracket).

**Error** : Failed to parse field [coordinates]","caused\_by":{"type":"parse\_exception","reason":"geo coordinates greater than 3 dimensions are not supported"}

```
  mutate {
        add_field => {"[geo][geobound][type]" => "envelope"}
  }
  ruby {
   code => '
     event.set("[geo][geobound][coordinates]", ["%{[geo][minlon]}","%{[geo][maxlat]}","%{[geo][maxlon]}","%{[geo][minlat]}"])
   '
  }

```

**output**

```
  "geo" => {
        "geobound" => {
              " type" => "envelope",
        "coordinates" => [
            [0] 0.0,
            [1] 0.0,
            [2] 0.0,
            [3] 0.0
        ]
    } }
```

---

<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: [June 8, 2020, 5:32pm UTC](https://discuss.elastic.co/t/issue-with-setting-geo-shape-array/232081/2 "2020-06-08T17:32:41Z")

</div>

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