Replace field value when equals "-"

Hi I would need to replace a field value (WindDirection,Temp,CityName,WindSpeed,Humidity) to some other value when it equals "-"

This is my data:

{
    "@timestamp" => 2020-08-10T18:54:08.055Z,
        "Europe" => {
        "DateTime" => {
             "Date" => "09.08.2020",
            "Time" => "15"
        },
               "City" => [
            [ 0] {
                 "WindDirection" => "NE",
                        "Temp" => "30",
                     "CityName" => "Amsterdam",
                "WindSpeed" => "07",
                       "Humidity" => "46"
            },

As you can see I have multiple cities.

Any help would be welcome :slight_smile:

If you are still using the ruby code I suggested then you could replace

            x[k] = v

with something like

            x[k] = (v == "-") ? -1 : v

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