# How to replace field value when it equals "-"

**URL:** <https://discuss.elastic.co/t/how-to-replace-field-value-when-it-equals/247899>\
**Category:** Logstash\
**Created:** [September 8, 2020, 1:29pm UTC](https://discuss.elastic.co/t/how-to-replace-field-value-when-it-equals/247899 "2020-09-08T13:29:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gbasic](https://avatars.discourse-cdn.com/v4/letter/g/9de0a6/32.png) [@gbasic](https://discuss.elastic.co/u/gbasic)\
**Post date:** [September 8, 2020, 1:29pm UTC](https://discuss.elastic.co/t/how-to-replace-field-value-when-it-equals/247899/1 "2020-09-08T13:29:51Z")

</div>

How to check if fields in "Data" are equal to "-" and if so change them to something else. This is my data (There are multiple cities in this JSON file with the same fields):

```auto
{
      "@version" => "1",
    "@timestamp" => 2020-09-08T13:14:29.058Z,
        "Europe" => {
        "DateTime" => {
            "Time" => "12",
             "Date" => "08.09.2020"
        },
               "City" => {
            "Data" => {
                        "Pressure" => "-",
                       "Humidity" => "83",
                        "cord" => {
                    "lat" => "52.37454030000001",
                    "lon" => "4.897975505617977"
                },
                 "WindDirection" => "SW",
                "WindSpeed" => "05",
                        "Temp" => "19"
            },
            "CityName" => "Amsterdam"
        }
    }
}

```

---

<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:** [October 6, 2020, 1:30pm UTC](https://discuss.elastic.co/t/how-to-replace-field-value-when-it-equals/247899/2 "2020-10-06T13:30:02Z")

</div>

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