# Decorate\_events returns the literal strin

**URL:** <https://discuss.elastic.co/t/decorate-events-returns-the-literal-strin/193574>\
**Category:** Logstash\
**Created:** [August 2, 2019, 3:07pm UTC](https://discuss.elastic.co/t/decorate-events-returns-the-literal-strin/193574 "2019-08-02T15:07:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mirajp](https://avatars.discourse-cdn.com/v4/letter/m/ba9def/32.png) [@mirajp](https://discuss.elastic.co/u/mirajp)\
**Post date:** [August 2, 2019, 3:07pm UTC](https://discuss.elastic.co/t/decorate-events-returns-the-literal-strin/193574/1 "2019-08-02T15:07:04Z")

</div>

Hi,  
I'm trying to use the decorate\_events feature in logstash to pull kafka details and put them into Elastic search. The issue is, in Elastic search, the value is being set to "%{[metadata][kafka][topic]}" rather than the topic name. Any suggestions on what I'm doing wrong?

Config as below:  
Input {  
kafka {  
bootstrap\_servers =\> "XXXX"  
topics =\> ["testTopic"]  
group\_id =\> "testgroup"  
decorate\_events =\> true  
}  
}

filter {

```
     json {
      source => "message"
      }

     mutate { add_field => { "kafkaT" => "%{[metadata][kafka][topic]}" } }

```

}  
Thanks  
Miraj

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [August 2, 2019, 3:55pm UTC](https://discuss.elastic.co/t/decorate-events-returns-the-literal-strin/193574/2 "2019-08-02T15:55:49Z")

</div>

That should be %{[@metadata][kafka][topic]}

---

<div class="post-metadata">

**Author:** ![mirajp](https://avatars.discourse-cdn.com/v4/letter/m/ba9def/32.png) [@mirajp](https://discuss.elastic.co/u/mirajp)\
**Post date:** [August 5, 2019, 7:34am UTC](https://discuss.elastic.co/t/decorate-events-returns-the-literal-strin/193574/3 "2019-08-05T07:34:06Z")

</div>

Thanks for the quick reply but that doesn't seem to work either. Now it returns %{[@metadata][kafka][topic]}

Any other ideas?  
Thanks

---

<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:** [September 2, 2019, 7:34am UTC](https://discuss.elastic.co/t/decorate-events-returns-the-literal-strin/193574/4 "2019-09-02T07:34:10Z")

</div>

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