Sending data to index through vega or by any other kibana feature

I want to calculate that how much an user spent time on a particular dashboard
i have created a timer through vega ( working)
now want to send this timer data when user closes/leaves the dashboard so that I can use this data
any idea ?

Hi @aman_kumar4,

Can you explain what you mean by use the data? Are you looking to index the data into an Elasticsearch index?

I'm not aware of a way to do that in Vega. But it should be possible with a Kibana plugin. I did find this guide with an example covering how to index data in a Kibana plugin that you could porbably adapt.

Hope that helps!

@carly.richmond thank you for your response
I just need to calculate the dashboard usage in my cluster.
for this I have created a counter timer through vega (custom visualisation), that starts automatically when we open the dashboard and then stops when we close the dashboard and then it will again start from zero if you open the dashboard again, so if any how I can store this timer data when closing the dashboard can help me to find for how much time a particular dashboard is used
the main issue is Im not able to store/index this timer data ?

is their any other way to calculate the dashboard usage?

Thanks for confirming @aman_kumar4. The storage of the timer data from Vega is the piece that I'm not sure is possible.

It's not something I've done myself, but I would say you could create a custom Kibana UI plugin to create the component and use simple JavaScript (Date.now() to subtract start and end times as per this post).

Hope that helps!