elasticsearch Vega和Kibana-动态时间戳标签和过滤查询
我正在使用Kibana进行我的第一次织女星可视化elasticsearch Vega和Kibana-动态时间戳标签和过滤查询,elasticsearch,kibana,vega,elasticsearch,Kibana,Vega,我正在使用Kibana进行我的第一次织女星可视化 { $schema: https://vega.github.io/schema/vega-lite/v2.json title: Event counts from all indexes data: { url: { %context%: true %timefield%: last_submission index: test_info body: {
{
$schema: https://vega.github.io/schema/vega-lite/v2.json
title: Event counts from all indexes
data: {
url: {
%context%: true
%timefield%: last_submission
index: test_info
body: {
aggs: {
time_buckets: {
date_histogram: {
field: last_submission
interval: {%autointerval%: true}
extended_bounds: {
min: {%timefilter%: "min"}
max: {%timefilter%: "max"}
}
min_doc_count: 0
}
}
}
size: 0
}
}
format: {property: "aggregations.time_buckets.buckets"}
}
mark: line
encoding: {
x: {
field: key
type: temporal
axis: {title: false}
}
y: {
field: doc_count
type: quantitative
axis: {title: "Document count"}
}
}
}
我这里有两个问题
1-由于可视化链接到Kibana仪表板,用户可以从主仪表板选择不同的时间窗口。正如您所见,标签始终采用完整格式。我需要根据时间窗口动态设置标签。
也就是说,如果用户选择日数据,则仅显示小时;如果用户选择周数据,则显示日,依此类推。
我需要做什么
2-我需要根据字段的特定值筛选事件,并使用主仪表板的时间窗口。可能吗?我曾尝试在Vega代码中添加查询过滤器,但如果同时设置了上下文和时间字段,则会出现以下错误:
url.%context%和url.%timefield%在为第二点设置url.body.query时不能使用,因为您关心上下文,为什么不简单地添加一个过滤器(位于搜索框的正下方)?我还尝试使用仪表板的时间窗口来选择我的时间范围。运气好吗?