Defining "valueType" in Kibana 5.0 script


(Ilia Katz) #1

How can I define valueType in Kibana 5.0 script? I am trying to define the following script:
{ "script": { "lang": "painless", "inline": "doc['someField'].value", "valueType": "string" } }

Similar to this thread

Trying to define valueType in Kibana 5 yields the following error:
Visualize: [script_parse_exception] unexpected field [valueType]

Thanks


(Ilia Katz) #3

Bump


(Shaunak Kashyap) #4

I'm moving this thread to the Elasticsearch category as this is more of an Elasticsearch question at this point.

It seems like valueType is no longer a part of the scripting syntax, per https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting-using.html. That might explain why you are getting this error in 5.0.


(Ilia Katz) #5

Thanks. So what should be my course of action?

Eventually, I want to create a a JSON Input script on a number field that manipulates its numeric value and returns a string (to be more concrete, the field holds duration in seconds and I want Kibana's visualization to display it as xx:yy where xx is the number of minutes and yy is the number of seconds).

Any suggestions?


(Ilia Katz) #6

Anybody?


(Ilia Katz) #7

Anybody?


(Ilia Katz) #8

In Kibana 5.0.0, a scripted field can be of type

  1. number
  2. string
  3. date
  4. boolean

I didn't try the other types besides number but I assume the string type, combined with painless script can be used to achieve what I was looking for.


(system) #9