Geo_shape - geo link problems with coordinates

I cannot see a way to create an array of arrays of floats using mutate. So use ruby

    mutate {
        add_field => {
            "[geo_link][type]" =>  "linestring"
        }
    }
    ruby {
        code => '
            event.set("[geo_link][coordinates]", [[ -87.623171, 41.881832], [ -87.623177, 41.881833]])
        '
    }

which results in

  "geo_link" => {
           "type" => "linestring",
    "coordinates" => [
        [0] [
            [0] -87.623171,
            [1] 41.881832
        ],
        [1] [
            [0] -87.623177,
            [1] 41.881833
        ]
    ]
},
1 Like