Open local file on link field

on kibana 7.4.2 i have a link field which point to local file.
when i press it i get http://localhost:5601/apps/c:/somefile.txt
but this cant be open by click
how can i remove the prefix of http://localhost:5601/apps

In your URL formatter you'll need to include the full URL (including http://) so it isn't treated as a relative URL.

This field is created by script doc['path.real'].value
How do i write the script to allow openning this file by click?