My log analytics reads amount data in cents. I would like the kibana change that into notes when displaying the field. (E.g. 1000 cents to 10)
Any formatter for that or any way of achieving this?
Another problem I also want to mention here is (sort of another related question) that my data comes from different countries with different currency. Anyway I can convert the data to one currency for displaying in kibana?
Thanks bhavyarm, i used the following script for converting cents to notes, and it worked:
{
"script" : {
"inline" : "doc['amount-cents'].value / 100",
"lang" : "painless"
}
}
But not sure how to handle the currency issue yet; as the the exchange rate fluctuate. I want everything to show in Swedish Krone while i have clients from Euro countries.
Are you looking for the conversion to be done based on when the document is indexed, or do you want a live conversion based on the current exchange rate, no matter what that is?
Doing this at index time is more performant, as you only have to do the calculation once. The downside there is that you don't get live exchange rates, so if you want to display up-to-date conversions, it wouldn't be possible with this approach. If this is acceptable, I'd suggest using Logstash to accomplish this. You could potentially integrate with a conversion service using the http filter.
If you need live exchange rates, then I don't have any great suggestions for you. The only idea that comes to mind is to create a custom visualization type which performs this conversion on the fly.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.