Slug help for getting slug from page

I am trying to get slug from url alone because I want to search and see if a slug has been created yet. I am mirroring a text in a text field and a slug field on each data.