elasticsearch-river-mongodb
elasticsearch-river-mongodb copied to clipboard
index script fields
Hi, I'm trying to change few fields strings using js, for example take only the last part of the URL taken from mongo through the river so in elasticsearch I'll have only the end of it. When creating the index (using curl) I added under "options" the following script: "script": "ctx.document.url = ctx.document.url.substr(-4);" I tried some manipulations such as adding "..." and others but nothing seems to work, I always get the full url. Can anyone suggest what is the right syntax to make it work?
Another thing I need to do is combine to fields - lat & long, to one "location" field in order to use it in Kibana, can anyone suggest the right script for that? (create new field called "location" which contain both field "lat" & "long" with comma between them). Thanks.
Update: also tried to use ctx._source.url but didn't work as well.
@gairom some news about this issue?
@gairom just solved. read this http://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html