# Nested json field mutate string to number

**URL:** https://discuss.elastic.co/t/nested-json-field-mutate-string-to-number/308991
**Category:** Logstash
**Created:** [July 6, 2022, 8:32am UTC](https://discuss.elastic.co/t/nested-json-field-mutate-string-to-number/308991 "2022-07-06T08:32:03Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mangeshmj1992](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@mangeshmj1992](https://discuss.elastic.co/u/mangeshmj1992)
#### Post date: [July 6, 2022, 8:32am UTC](https://discuss.elastic.co/t/nested-json-field-mutate-string-to-number/308991/1 "2022-07-06T08:32:03Z")

</div>

Hello, I'm trying to convert a nested json field from a string to an integer. But i am not getting field into Integer.

field Name:

```auto
events.data.custom_attributes.txn_total_time_to_complete_in_sec

```

Code:

```auto
    mutate {convert => { "events.data.custom_attributes.txn_total_time_to_complete_in_sec" => "integer" }}

OR

 mutate {convert => { "[events][data[custom_attributes][txn_total_time_to_complete_in_sec]" => "integer" }}

```

Can you please help on this.

---

<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: [August 3, 2022, 8:32am UTC](https://discuss.elastic.co/t/nested-json-field-mutate-string-to-number/308991/2 "2022-08-03T08:32:13Z")

</div>

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