Kibana global filter isn't applied to Vega-lite visualizations

Hi there,

I am using Kibana version 8.5.0
I have added some visualizations made in Kibana and some custom visualizations made in Vega-lite on a single dashboard. When I am trying to filter data on the basis control or global filter available on dashboard, so visualizations made in Kibana are changed as per the filter, but visualizations made in Vega-lite are not changed as per the global filter.

I am searching a solution for that, and I have tried some of the solution available here like adding
%context%: true

Some other code like

"query": {
"bool": {
"must": [
"%dashboard_context-must_clause%",
{
"range": {
"eventTime": {"%timefilter%": true}
}
}
],
"must_not": ["%dashboard_context-must_not_clause%"],
"filter": [
{
"term": {"status": 0}
}
]
}
}

Please help me to resolve this problem.

My code is this
{
$schema: https://vega.github.io/schema/vega-lite/v2.json
"config": {"view": {"width": 400, "height": 300}, "mark": {"tooltip": false}},
"title": {
"text": "Scheme Details",
"anchor": "middle"
},
data: {
url: {
%context%: true
index: krishi_maual_data2
body: {
size: 10000
_source: [
"@timestamp"
"channel"
"Scheme"
"FinancialInstitutions"
"Ministry"
"State"
]
}
}
format: { property: "hits.hits" }
}
"mark": "bar",
"encoding": {
"color": {"type": "nominal", "field": "_source.Scheme.name", "title": "Scheme"},
"y": { "field": "_source.@timestamp", "type": "ordinal", "timeUnit": "month", "title": "Time"},
"x": { "aggregate":"sum", "type": "quantitative", "field": "value", "title": ""},
"tooltip": [
{
aggregate: sum
"field": "value",
"type": "quantitative"
title: Total
},
{
"field": "_source.Scheme.name",
"type": "ordinal"
title: "Scheme"
}
]
},
"selection": {
"selector006": {
"type": "single",
"fields": ["Select"],
"bind": {
"input": "select",
"options": ["_source.Scheme.app_applied", "_source.Scheme.app_approved", "_source.Scheme.amount_approved", "_source.Scheme.amount_disbursed"],
"labels":["Application Applied(in No.)", "Application Approved(in No.)", "Amount Approved(in Cr.)", "Amount Disbursed(in Cr.)"]
"name": "Select"
},
"init": {"Select": "_source.Scheme.app_applied"}
}
},
"transform": [
{
"fold": ["_source.Scheme.app_applied", "_source.Scheme.app_approved", "_source.Scheme.amount_approved","_source.Scheme.amount_disbursed"],
"as": ["Select", "value"]
},
{"filter": {"selection": "selector006"}}
]
}

I tried to reproduce this in my 8.5.3 and I couldn't.

cc @Andrew_Tate / @Marta_Bondyra any inputs?

Thanks,
Bhavya

Hi < bhavyarm>

thanks to you for reply.

I think, I did it by adding the @timestamp in URL section in each Vega- Lite visualizations as %timefield%: @timestamp. After adding this when we change the time from time slider like 30 days, 90 days etc, the changes reflect on each Vega-Lite visualizations.

data: {
url: {
%context%: true
%timefield%: @timestamp
index: krishi_maual_data2
body: {
size: 10000
_source: [
"@timestamp"
"channel"
"Scheme"
"FinancialInstitutions"
"Ministry"
"State"
]
}
}
format: { property: "hits.hits" }
}

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.