Plugin to get selected columns from Saved search Dashboard panel

Hello,
I wanted to know if there is a way to get the selected columns from a Saved search Dashboard panel. How is this done using a plugin? Can someone share an example code?
Using Kibana 7.5.

Thanks

You could certainly try to create a scripted field to get the selected columns . It can be hard to get scripted fields working correctly. So my advice is to work incrementally towards your solution. You query scripted fields with the Kibana query language, and can filter them using the filter bar.

https://www.elastic.co/guide/en/kibana/current/scripted-fields.html

The scripted fields are based on the Java implementation of Regex, which is kinda hard to debug. Another way, I can suggest is that you can try to achieve the same result by using Java string manipulation functions.

hope it helps
Rashmi