# Replace file path with it's content

**URL:** <https://discuss.elastic.co/t/replace-file-path-with-its-content/289599>\
**Category:** Logstash\
**Created:** [November 18, 2021, 1:33pm UTC](https://discuss.elastic.co/t/replace-file-path-with-its-content/289599 "2021-11-18T13:33:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohammed\_Sayeed](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mohammed_sayeed/32/78690_2.png) [@Mohammed\_Sayeed](https://discuss.elastic.co/u/Mohammed_Sayeed)\
**Post date:** [November 18, 2021, 1:33pm UTC](https://discuss.elastic.co/t/replace-file-path-with-its-content/289599/1 "2021-11-18T13:33:14Z")

</div>

I'm trying to read a csv and replace file path with it's content.

for example i have a csv file like this:  
data1, data2, path1  
data3, data4, path2

path1 data:- data5  
path2 data:- data6

i want to create a document like  
{  
"Id":"1"  
"field1":"data1"  
"field2":"data2"  
"field3":"data5"  
},  
..so on.

is there any way to do it with using ruby filter??

---

<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:** [December 16, 2021, 1:33pm UTC](https://discuss.elastic.co/t/replace-file-path-with-its-content/289599/2 "2021-12-16T13:33:55Z")

</div>

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