# Linking from a Kibana plugin into the Security app using the Locator service

**URL:** <https://discuss.elastic.co/t/linking-from-a-kibana-plugin-into-the-security-app-using-the-locator-service/305868>\
**Category:** Kibana\
**Tags:** kibana-plugin-development\
**Created:** [May 29, 2022, 5:33am UTC](https://discuss.elastic.co/t/linking-from-a-kibana-plugin-into-the-security-app-using-the-locator-service/305868 "2022-05-29T05:33:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BitBite](https://avatars.discourse-cdn.com/v4/letter/b/9de0a6/32.png) [@BitBite](https://discuss.elastic.co/u/BitBite)\
**Post date:** [May 29, 2022, 5:33am UTC](https://discuss.elastic.co/t/linking-from-a-kibana-plugin-into-the-security-app-using-the-locator-service/305868/1 "2022-05-29T05:33:21Z")

</div>

The following document provides excellent tips for deep linking into the Discover app from within a Kibana plugin using a [locator service](https://github.com/elastic/kibana/blob/main/src/plugins/share/common/url_service/locators/README.md).  
[https://www.elastic.co/guide/en/kibana/master/kibana-navigation.html](https://www.elastic.co/guide/en/kibana/master/kibana-navigation.html)

The two main considerations are:

1. Getting a proper base path
2. 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-\*')](https://localhost:5601/s/my-space/app/security/hosts/events?sourcerer=(default:!(%27logs-*%27)))&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)))

---

<div class="post-metadata">

**Author:** ![cheiligers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cheiligers/32/73114_2.png) [@cheiligers](https://discuss.elastic.co/u/cheiligers)\
**Post date:** [June 14, 2022, 11:43pm UTC](https://discuss.elastic.co/t/linking-from-a-kibana-plugin-into-the-security-app-using-the-locator-service/305868/2 "2022-06-14T23:43:18Z")

</div>

@BitBite welcome back to the Discuss forum!  
The security plugin is an x-pack plugin and you need to have security enabled to use any of those features.  
I could only find one match to `/app/security/hosts/events` in the main branch and that's for a [cypress test setup](https://github.com/elastic/kibana/blob/main/x-pack/plugins/security_solution/cypress/urls/navigation.ts#L36-L41). Essentially, your plugin will have to depend on the security\_solution xpack plugin, I'm not familiar with integrating to that one though. Maybe the README is a good starting point for that specific plugin?

As for using deep links in your app, maybe the [type documentation](https://github.com/elastic/kibana/blob/main/src/core/public/application/types.ts#L233-L270) on deep linking could give you some pointers.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 12, 2022, 11:44pm UTC](https://discuss.elastic.co/t/linking-from-a-kibana-plugin-into-the-security-app-using-the-locator-service/305868/3 "2022-07-12T23:44:05Z")

</div>

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