How to write a multi step logstash process

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?

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

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