通过ES提取到Kibana的数据无法将Epoch字段标识为时间戳

时间:2018-08-03 22:06:00

标签: regex elasticsearch kibana apache-nifi

我有一个CSV文件,其字段为'EpochWithMicroSec'数据类型(Ex- 1512520845000),并且我希望CSV导入Elasticsearch中,同时在创建索引时将Epoch属性识别为Timestamp。我可以将我的数据提取到ES中,但是'EpochWithMicroSec'字段的数据类型在Kibana中显示为String。您能帮我编写正确的Avro模式,以便Kibana将此识别为Timestamp。基本上可以帮助我将字段'EpochWithMicroSec'作为Date类型传递给ES。谢谢。

我的avro模式如下:

{
 "type": "record",
 "name": "AVLRecord",
 "fields" : [
    {"name": "RecordingTime", "type": "double"},
    ***{"name": "EpochWithMicroSec", "type":{ "type":"long", "logicalType":"timestamp-millis"}},***
    {"name": "PEC_Demand_Voltage", "type": "double"},
    {"name": "PEC_Demand_Current", "type": "double"},
    {"name": "PEC_Demand_Power", "type": "double"},
    {"name": "PEC_Measured_Voltage", "type": "double"},
    {"name": "PEC_Measured_Current", "type": "double"},
    {"name": "PEC_Measured_Power", "type": "double"},   
    {"name": "BMU_Stats_Pack_BlkVolt_Min", "type": "double"},
    {"name": "BMU_Stats_Pack_BlkVolt_Max", "type": "double"},
    {"name": "BMU_Stats_Temp_Cell_Min", "type": "double"},
    {"name": "BMU_Stats_Temp_Cell_Max", "type": "double"},
    {"name": "BMU_Stats_Pack_Soc", "type": "double"},
    {"name": "BMU_Stats_Pack_Curr", "type": "double"},
    {"name": "BMU_Stats_Pack_Vout", "type": "double"},
    {"name": "BMU_Stats_Pack_Vbatt", "type": "double"},
    {"name": "BMU_Lim_Chrg_Curr", "type": "double"},    
    {"name": "BMU_Lim_Chrg_Volt", "type": "double"},
    {"name": "BMU_Lim_Chrg_Mode", "type": "double"},
    {"name": "Novec_Flow_Rate", "type": "double"},
    {"name": "HX_Water_In", "type": "double"},
    {"name": "HX_Novec_In", "type": "double"},  
    {"name": "M1_TC2", "type": "double"},
    {"name": "M1_TC6", "type": "double"},
    {"name": "M1_TC7", "type": "double"},
    {"name": "M1_TC8", "type": "double"}
 ]
}

0 个答案:

没有答案