# Rename particular field using logstash 2.4.0?

**URL:** <https://discuss.elastic.co/t/rename-particular-field-using-logstash-2-4-0/76583>\
**Category:** Logstash\
**Created:** [February 27, 2017, 7:25am UTC](https://discuss.elastic.co/t/rename-particular-field-using-logstash-2-4-0/76583 "2017-02-27T07:25:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yaswanth](https://avatars.discourse-cdn.com/v4/letter/y/94ad74/32.png) [@Yaswanth](https://discuss.elastic.co/u/Yaswanth)\
**Post date:** [February 27, 2017, 7:25am UTC](https://discuss.elastic.co/t/rename-particular-field-using-logstash-2-4-0/76583/1 "2017-02-27T07:25:06Z")

</div>

I have slow logs like this...

```
[2017-01-13 14:37:48,943][DEBUG][index.search.slowlog.query] [Spectra] [test][4] took[50micros], took_millis[0], types[], stats[], search_type[QUERY_THEN_FETCH], total_shards[5], source[], extra_source[], 
[2017-01-13 12:58:09,844][WARN][index.search.slowlog.query] [Spectra] [testindex-stats][1] took[16.2ms], took_millis[16], types[], stats[], search_type[QUERY_THEN_FETCH],

```

I need to rename took[50micros] to took[50ms] in all the slowlogs . How can i able to achieve this using logstash ?

---

<div class="post-metadata">

**Author:** ![Yaswanth](https://avatars.discourse-cdn.com/v4/letter/y/94ad74/32.png) [@Yaswanth](https://discuss.elastic.co/u/Yaswanth)\
**Post date:** [February 27, 2017, 8:17am UTC](https://discuss.elastic.co/t/rename-particular-field-using-logstash-2-4-0/76583/2 "2017-02-27T08:17:47Z")

</div>

It worked fine with gsub filter..

```
mutate {
     gsub => [

      "TOOK", "micros", "ms"
    ]
}
```

---

<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:** [March 27, 2017, 8:18am UTC](https://discuss.elastic.co/t/rename-particular-field-using-logstash-2-4-0/76583/3 "2017-03-27T08:18:00Z")

</div>

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