Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/319.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
<img src="//i.stack.imgur.com/RUiNP.png" height="16" width="18" alt="" class="sponsor tag img">elasticsearch 织女星:在数据中添加缺少的信息_<img Src="//i.stack.imgur.com/RUiNP.png" Height="16" Width="18" Alt="" Class="sponsor Tag Img">elasticsearch_Kibana_Vega Lite - Fatal编程技术网 elasticsearch 织女星:在数据中添加缺少的信息,elasticsearch,kibana,vega-lite,elasticsearch,Kibana,Vega Lite" /> elasticsearch 织女星:在数据中添加缺少的信息,elasticsearch,kibana,vega-lite,elasticsearch,Kibana,Vega Lite" />

elasticsearch 织女星:在数据中添加缺少的信息

elasticsearch 织女星:在数据中添加缺少的信息,elasticsearch,kibana,vega-lite,elasticsearch,Kibana,Vega Lite,在kibana中,在Vega lite可视化中,我想创建一个应用程序随时间变化的过渡状态图(AAAA)。(时间线)状态具有固定值(初始、开始、运行…) 在x轴上显示时间戳, 在州一级, 用于跟踪状态级别的矩形或条 |== |======= |================ ______________________________ t0 t1 t2 我的数据来自ElasticSearch中的一个查询,格式如下 timestamp app state t0 AAAA Init


在kibana中,在Vega lite可视化中,我想创建一个应用程序随时间变化的过渡状态图(AAAA)。(时间线)
状态具有固定值(初始、开始、运行…)

在x轴上显示时间戳,
在州一级,
用于跟踪状态级别的矩形或条

|==
|=======
|================
______________________________
t0 t1 t2

我的数据来自ElasticSearch中的一个查询,格式如下

timestamp  app  state
  t0    AAAA  Init
  t1    AAAA  start
  t2    AAAA  Running
  t3    AAAA  stopped
在织女星中,我想用条形或矩形来表示状态, 例如:Init状态将由一个从t0开始到t1结束的矩形表示。但我没有这些信息!t1在下一个数据行中

是否可以利用下一行计算该值。 数据将是这样的

timestamp  app  state    ends 
  t0    AAAA  Init         t1
  t1    AAAA  start        t2 
  t2    AAAA  Running      t3
  t3    AAAA  stopped      t4 


欢迎任何帮助

您可以通过使用
lead
操作的窗口变换来查找下一个值。例如:

{
  "data": {
    "values": [
      {"timestamp": 0, "app": "A", "state": "init"},
      {"timestamp": 10, "app": "A", "state": "start"},
      {"timestamp": 25, "app": "A", "state": "run"},
      {"timestamp": 30, "app": "A", "state": "stop"},
      {"timestamp": 40, "app": "B", "state": "init"},
      {"timestamp": 55, "app": "B", "state": "start"},
      {"timestamp": 75, "app": "B", "state": "run"},
      {"timestamp": 85, "app": "B", "state": "stop"},
      {"timestamp": 90, "app": null, "state": "init"}
    ]
  },
  "transform": [
    {"window": [{"op": "lead", "field": "timestamp", "as": "t_stop"}]},
    {"filter": "datum.app != null"}
  ],
  "encoding": {
    "color": {"type": "nominal", "field": "app"},
    "x": {"type": "quantitative", "field": "timestamp"},
    "x2": {"type": "quantitative", "field": "t_stop"},
    "y": {
      "type": "nominal",
      "field": "state",
      "sort": {"op": "sum", "field": "timestamp", "order": "ascending"}
    }
  },
  "mark": "bar",
  "$schema": "https://vega.github.io/schema/vega-lite/v2.6.0.json"
}

t4来自哪里?这是与表中下一个应用程序的初始步骤相关联的时间吗?我有一个问题,无法将此示例适应我的上下文。时间戳不是一个直接值,而是一个时间数据,如:@Timestamp:“2016-04-05T15:21:06.494Z”。。。我想我也必须转换它,不是吗?如果你对时间戳数据使用
“type”:“temporal”
而不是
“type”:“quantitative”
,它应该可以正常工作。