# Recreate new field from old field

**URL:** https://discuss.elastic.co/t/recreate-new-field-from-old-field/254567
**Category:** Logstash
**Created:** [November 6, 2020, 6:58pm UTC](https://discuss.elastic.co/t/recreate-new-field-from-old-field/254567 "2020-11-06T18:58:25Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)
#### Post date: [November 6, 2020, 6:58pm UTC](https://discuss.elastic.co/t/recreate-new-field-from-old-field/254567/1 "2020-11-06T18:58:25Z")

</div>

I have used add\_filed, remove\_field, rename etc.. many time over on logstash

now I have something different that I can't quite figure out.

runnign nvidiabeat and it gives me following

```
{
        "clocks":{"mem":405,"sm":139,"gr":139},
        "memory":{"used":623,"total":11172},
         "utilization":{"gpu":0,"memory":0},
        "pstate":8,
        "power":{"limit":135,"draw":16.38},
        "driver_version":384.9,
        "fan":{"speed":23},
        "type":"nvidiagpubeat",
        "count":4,
        "name":"GeForceGTX1080Ti",
        "temperature":{"gpu":30}
 }

```

I want to move whole thing under

```
"system": {
    "gpu": {
             "clocks":{"mem":405,"sm":139,"gr":139},
            "memory":{"used":623,"total":11172},
             "utilization":{"gpu":0,"memory":0},
            "pstate":8,
            "power":{"limit":135,"draw":16.38},
            "driver_version":384.9,
            "fan":{"speed":23},
            "type":"nvidiagpubeat",
            "count":4,
            "name":"GeForceGTX1080Ti",
            "temperature":{"gpu":30}
   }
}

```

I have try this as test but didn't work

```
 if [utilization][gpu] {
        mutate { add_field => {"[system][gpu][utilization][gpu]" => "%{[utilization][gpu]}" }
     }
  }
```

---

<div class="post-metadata">

### Author: ![elasticforme](https://avatars.discourse-cdn.com/v4/letter/e/f05b48/32.png) [@elasticforme](https://discuss.elastic.co/u/elasticforme)
#### Post date: [November 6, 2020, 7:20pm UTC](https://discuss.elastic.co/t/recreate-new-field-from-old-field/254567/2 "2020-11-06T19:20:24Z")

</div>

well it is working now.  
I had this inside some other loop and hence it was not even picking up.

consider it as solved.

---

<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: [December 4, 2020, 7:20pm UTC](https://discuss.elastic.co/t/recreate-new-field-from-old-field/254567/3 "2020-12-04T19:20:31Z")

</div>

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