# How to write a multi step logstash process

**URL:** <https://discuss.elastic.co/t/how-to-write-a-multi-step-logstash-process/92300>\
**Category:** Logstash\
**Created:** [July 7, 2017, 4:41pm UTC](https://discuss.elastic.co/t/how-to-write-a-multi-step-logstash-process/92300 "2017-07-07T16:41:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chetan\_vartak](https://avatars.discourse-cdn.com/v4/letter/c/fbc32d/32.png) [@chetan\_vartak](https://discuss.elastic.co/u/chetan_vartak)\
**Post date:** [July 7, 2017, 4:41pm UTC](https://discuss.elastic.co/t/how-to-write-a-multi-step-logstash-process/92300/1 "2017-07-07T16:41:35Z")

</div>

I need to Read a csv file which contains (zipcode, latitude, longitude).  
Then for each zipcode find all documents in ES  
Then update the document with latitude and longitude (geo codes)

Is something like this possible with logstash?

---

<div class="post-metadata">

**Author:** ![inhinyera16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inhinyera16/32/61625_2.png) [@inhinyera16](https://discuss.elastic.co/u/inhinyera16)\
**Post date:** [July 10, 2017, 4:02am UTC](https://discuss.elastic.co/t/how-to-write-a-multi-step-logstash-process/92300/2 "2017-07-10T04:02:26Z")

</div>

> [@chetan\_vartak](#):
>
> de find all documents in ES  
> Then update the document with l

Yes it is possible using translate filter. You need need to create 2 separate translate filter and 2 separate reference csv for latitude and longitude having zipcode as key. The csv should contain 2 columns, without headers having the 1st column as the zipcode and the second column as latitude or longitude. The first column must be inside the double quote ex "zipcode",lat or "zipcode",long

See below config for translate filter

```
translate {
	field => "zipcode"
	destination => "latitude"
	dictionary_path => '/path/to/csv/sample.csv'		
	override => true
}

```

see more details here [Translate filter plugin | Logstash Reference [8.11] | Elastic](https://www.elastic.co/guide/en/logstash/current/plugins-filters-translate.html)

---

<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:** [August 7, 2017, 4:02am UTC](https://discuss.elastic.co/t/how-to-write-a-multi-step-logstash-process/92300/3 "2017-08-07T04:02:29Z")

</div>

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