How to scale input data when use logstash

(Ngọc Phạm) #1

Hi . Im newbie in elasticsearch and logstash. And I have some question . Please help me :slight_smile:

Im trying input data from postgres database into elasticsearch. I config and it running ok. But now i want scale data before input it into elasticsearch server.

Example : i have three field like this:

i want scale data in field name . It look like John --> J o h n . Lina ---> L i n a
i want only field name scale like it when appear only in elasticsearch.
Thanks for your help :x :x

(Magnus Bäck) #2

What do you mean by "scale"? Perhaps you can give an example of what you currently get (e.g. with a stdout { codec => rubydebug } output and show us what you want to get instead.

From what you write above it looks like you want to insert spaces between each letter in the name field, but that doesn't make sense.

(Ngọc Phạm) #3

First thanks for your help.

yes,my expected is spaces between each letter in the name field. I want increase more term in elasticsearch. Because if only "John". it is only 1 term. But " J" "o" "h" "n" it like 4 term.

I want custom search in elasticsearch like my mind :slight_smile:

Logstash have anything can spaces between each letter in someone field i want ?

Thanks you very much

(Magnus Bäck) #4

You can use a ruby filter to accomplish that, but I think you should solve this on the Elasticsearch side. It should be possible to define an analyzer that emits one term per letter.

(system) #5