Search code examples
elasticsearchlogstashkibanakibana-4logstash-configuration

Is it possible to convert a string into an int, in Kibana?


I'm trying to create a data table using kibana for a set of data in an index. I'm having a field in my database which is a String, and I have to convert it to an int so that I could use it for the sum aggregation in Kibana metrics.

Is there a way that I can directly convert it through Kibana or should I go with the logstash and do the conversion first?


Solution

  • Once the value is in Elasticsearch as a string, there's no way to change it to an integer. You'll have to drop your index and re-index the data.

    At that point you can add an index template or use a convert filter in logstash to convert the string to an integer.