# Problem in using filter-cipher

**URL:** <https://discuss.elastic.co/t/problem-in-using-filter-cipher/51553>\
**Category:** Logstash\
**Created:** [June 1, 2016, 12:09pm UTC](https://discuss.elastic.co/t/problem-in-using-filter-cipher/51553 "2016-06-01T12:09:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanju1323](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@sanju1323](https://discuss.elastic.co/u/sanju1323)\
**Post date:** [June 1, 2016, 12:09pm UTC](https://discuss.elastic.co/t/problem-in-using-filter-cipher/51553/1 "2016-06-01T12:09:53Z")

</div>

Hi,

I'm working on logstash-filter-cipher to encode and decode the data. But nothing is coming up.

I have an "ID" field and I want to encode it. The code that I was using is as follows.

input {  
elasticsearch {  
host =\> ["localhost"]  
index =\> "test  
}  
}

filter {  
cipher {  
algorithm =\> "aes-256-cbc"  
cipher\_padding =\> 1  
iv =\> "1234567890123456"  
key =\> "12345678901234567890123456789012"  
key\_size =\> 32  
mode =\> "encrypt"  
source =\> "ID"  
target =\> "ID\_crypted"  
base64 =\> true  
}  
cipher {  
algorithm =\> "aes-256-cbc"  
cipher\_padding =\> 1  
iv =\> "1234567890123456"  
key =\> "12345678901234567890123456789012"  
key\_size =\> 32  
mode =\> "decrypt"  
source =\> "ID\_crypted"  
target =\> "ID\_decrypted"  
base64 =\> true  
}  
}

output {  
elasticsearch\_http  
{  
host =\> "localhost"  
index =\> "new\_test"  
index\_type =\> "new\_test"  
}  
stdout {  
codec =\> json  
#codec =\> rubydebug  
}  
}

Please look in to the code and please suggest me if any modifications required 🙂

Regards,  
Sanjay Reddy

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 2, 2016, 1:09am UTC](https://discuss.elastic.co/t/problem-in-using-filter-cipher/51553/2 "2016-06-02T01:09:57Z")

</div>

What does your input look like.

---

<div class="post-metadata">

**Author:** ![sanju1323](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@sanju1323](https://discuss.elastic.co/u/sanju1323)\
**Post date:** [June 2, 2016, 10:36am UTC](https://discuss.elastic.co/t/problem-in-using-filter-cipher/51553/3 "2016-06-02T10:36:32Z")

</div>

@warkolm

Here I'm providing the data in ELK log format and also csv format

```
 {
 "_index": "test",
 "_type": "test",
 "_id": "AVUL9hUOkpaHCVuxxRNi",
 "_version": 1,
 "_score": 1,
 "_source": {
      "ID": "1323",
      "Age": "23",
      "Gender": "M",
      "Remarks": "Good",
      "Improvement": "Yes"
   }
 }

```

![](https://us1.discourse-cdn.com/elastic/original/2X/d/dc149f0a970bb1fc02f9849076e284990e37acee.png)

please help

---

<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:** [July 6, 2017, 4:54am UTC](https://discuss.elastic.co/t/problem-in-using-filter-cipher/51553/4 "2017-07-06T04:54:48Z")

</div>


