# Doc fields in CSV destination

**URL:** https://discuss.elastic.co/t/doc-fields-in-csv-destination/96099
**Category:** Logstash
**Created:** [August 7, 2017, 12:12pm UTC](https://discuss.elastic.co/t/doc-fields-in-csv-destination/96099 "2017-08-07T12:12:09Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![AHurtado](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ahurtado/32/20867_2.png) [@AHurtado](https://discuss.elastic.co/u/AHurtado)
#### Post date: [August 7, 2017, 12:12pm UTC](https://discuss.elastic.co/t/doc-fields-in-csv-destination/96099/1 "2017-08-07T12:12:09Z")

</div>

Hi,

I'm very new in ELK stack and I'm trying to learn.

I'd like to enrich a document adding fields based on a translate filter and a dictionary\_path value. My question is: when building the dictionary\_path file, can I use fieds from the doc as part on the results?

I mean...Let's say I have a field called "Classe" and a field called "Severitat". Imagine I have this CSV dictionary for field "Classe" whose result is field "Missatge", which has to be filled using "Severitat" field's value:

"Severitat","Missatge"  
"0","Missatge per a events de tipus %{Classe} igual a %{Severitat}"  
"1","Missatge per a dades de tipus %{Classe} igual a %{Severitat}"

Can I build the "Missatge" field using a translate filter but using at the same time fields from the same document? Or does it have to be an static text?

Thanks,

Albert

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [August 9, 2017, 6:14am UTC](https://discuss.elastic.co/t/doc-fields-in-csv-destination/96099/2 "2017-08-09T06:14:54Z")

</div>

I believe the text needs to be static.

---

<div class="post-metadata">

### Author: ![AHurtado](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ahurtado/32/20867_2.png) [@AHurtado](https://discuss.elastic.co/u/AHurtado)
#### Post date: [August 9, 2017, 8:37am UTC](https://discuss.elastic.co/t/doc-fields-in-csv-destination/96099/3 "2017-08-09T08:37:26Z")

</div>

Hi,

That's what experience says to me.  
I had to add a mutate-\>gsub after the csv filter to change labels for field values.

Shame...

Thanks!

Albert

---

<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 6, 2017, 8:37am UTC](https://discuss.elastic.co/t/doc-fields-in-csv-destination/96099/4 "2017-09-06T08:37:34Z")

</div>

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