Kibana 脚本字段

Kibana scripted field

我正在尝试在 Kibana 4.5.1 中编写一个脚本字段,以便从 @timestampt 字段中提取小时。我只是按照以下 link 中的示例进行操作,但它给了我一个解析错误: https://www.elastic.co/blog/kibana-4-beta-3-now-more-filtery

现在在 link 中它说这从 Kibana 4.0.0 开始不起作用,因为脚本字段现在基于 Lucene。那么有人知道 Lucene 中的等效代码是什么吗? Groovy 表达式如下: Integer.parseInt(new Date(doc["@timestamp"].value).format("H")) 其中 @timestamp 是包含格式为 MMM dd HH:mm:ss.SSS 的日期的字段名称,我需要提取 HH 值.

他们现在使用lucene表达式: doc["creation_ts"].getHourOfDay()

https://www.elastic.co/guide/en/elasticsearch/reference/2.4/modules-scripting.html#_lucene_expressions_scripts

https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html#_lucene_expressions_scripts