I have just one problem with my filter. Indeed, my filter works like this:
convert => ["typeLambert", x, y]
where:
- typelambert is the type of lambert (string)
- x is the lattitude in lamber (float type)
- y is the longitude in lambert (float type)
where I write, for instance, convert => ["LambertIIExtended", 2478517.33, 547536.68] , it works well !
But, when I read a file or a kafka topic where I have parameters like below:
{"lati":2478517.33, "longi":547536.68}
{"lati":2699120.65, "longi":544959.56}
{"lati":2149001.71, "longi":588529.14}
It does not work when I write convert => ["LambertIIExtended", "%{[lati]}", "%{[longi]}"]
I printed the output results and ruby does not get the float value of my parameters lati and longi, it reads and prints them exactly like strings "%{[lati]}" and "%{[longi]}". Do you knwo how I could solve this ?
I put in Annexe my filter part.
My logstash filter part:
filter {
lambert {
convert => ["LambertIIExtended", "%{[lati]}", "%{[longi]}"] #it does work because
#convert => ["LambertIIExtended", 2478517.33, 547536.68] #it works
latitude => ["latnew"]
longitude => ["longnew"]
}
}
PS: if you need my ruby code, I can provide it. (it is just a little bit long that's why I did not add here)