Carriage return and float to integer


(Newbie) #1

Hello,

I try to upload new type of data.

In flat files on format csv, each ten lines i have a return carriage.

101;2907035;/suivi_message_alerte;3;150328;150390;101;853531;/acc1200;0;0;;1593384;00;150330;0;2
101;290371;/sualerte;3;15049;15384;L;L;101;29242;/a00;0;0;172800;15035
$  
101;29293;/suierte;3;1503393448;150339;101;31954;/acco1200;0;-3505;172800;15;15005;00;153508;0;1

I thought to use if condition like that :

if [message] =~ "\n" {
      drop { }
    }

What do you think ?

Also :

In my files i have sometimes float number like 82,134576 or 91,23445 or 99,49565

I want integer number with rounded number, example for :

82,134576 => 80
91,23445 => 90
99,49565 => 90

I know, if i define mapping in elasticsearch at "valuefloat" type = integer, 82,134 become 82 but i want really 80.

The must have will be :

82,134576 => 80
91,23445 => 80
99,49565 => 80

It's possible ?

To remove line if a specific field are null/blank i can use this no ?

if [mandatory_value] = null {
drop {[message]}
}

Also, about phone number. If i have phone number under this for "00033632345487", can i format to 33632345487 ? I am not expert in regex...


(system) #2

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