The following document provides excellent tips for deep linking into the Discover app from within a Kibana plugin using a locator service.
https://www.elastic.co/guide/en/kibana/master/kibana-navigation.html
The two main considerations are:
- Getting a proper base path
- Specifying state
I want to avoid hard-coding brittle URL's within our plugin's source code when linking out to:
Security > Hosts > Events
GitHub's README, in the link above, points to the source code for the Discover app's locator contract:
kibana > src > plugins > discover > public > locator.ts
However I can't find a plugin named "security" in the repository, perhaps that's because it's simply a core service? Is there any guidance for generating robust state to be used within the URL's name/value pairs, rather than embedding an HREF like this in our source code?
https://localhost:5601/s/my-space/app/security/hosts/events?sourcerer=(default:!('logs-*'))&query=(language:kuery,query:%27id:%20%223455a6ae-1260-4560-a0cf-b22a154e7111%22%27)&timerange=(global:(linkTo:!(timeline),timerange:(from:%272022-05-28T07:00:00.000Z%27,fromStr:now%2Fd,kind:relative,to:%272022-05-29T06:59:59.999Z%27,toStr:now%2Fd)),timeline:(linkTo:!(global),timerange:(from:%272022-05-28T07:00:00.000Z%27,fromStr:now%2Fd,kind:relative,to:%272022-05-29T06:59:59.999Z%27,toStr:now%2Fd)))