# Can I decode the values in Logstash

**URL:** https://discuss.elastic.co/t/can-i-decode-the-values-in-logstash/181796
**Category:** Logstash
**Created:** [May 20, 2019, 10:52am UTC](https://discuss.elastic.co/t/can-i-decode-the-values-in-logstash/181796 "2019-05-20T10:52:57Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![sjabiulla](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sjabiulla/32/48429_2.png) [@sjabiulla](https://discuss.elastic.co/u/sjabiulla)
#### Post date: [May 20, 2019, 10:52am UTC](https://discuss.elastic.co/t/can-i-decode-the-values-in-logstash/181796/1 "2019-05-20T10:52:57Z")

</div>

Hi,

I have the key value pairs in the log message and I want to do data mapping before indexing the data to ElasticSearch.

**Sample Log Message 1: operation=1 timetaken=50**  
**Sample Log Message 2: operation=2 timetaken=100**

I want the output in ElasticSearch to be as below.

```
{
 {
   "operation" : "ABC",
   "timetaken" : "50"
 },
 {
   "operation" : "XYZ",
   "timetaken" : 100
 }
}

```

I want to map operation values as 1 to ABC & 2 to XYZ . Is this possible with any filters ?

---

<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: [May 20, 2019, 11:06am UTC](https://discuss.elastic.co/t/can-i-decode-the-values-in-logstash/181796/2 "2019-05-20T11:06:35Z")

</div>

You could try using a kv filter to parse the message and then a translate fitler to map the values.

---

<div class="post-metadata">

### Author: ![sjabiulla](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sjabiulla/32/48429_2.png) [@sjabiulla](https://discuss.elastic.co/u/sjabiulla)
#### Post date: [May 20, 2019, 11:34am UTC](https://discuss.elastic.co/t/can-i-decode-the-values-in-logstash/181796/3 "2019-05-20T11:34:14Z")

</div>

Thank you. That should work

---

<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: [June 17, 2019, 11:39am UTC](https://discuss.elastic.co/t/can-i-decode-the-values-in-logstash/181796/4 "2019-06-17T11:39:48Z")

</div>

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