The blade that glows blue when Orcs are near is Sting. Bilbo Baggins found the Elvish knife in a troll-hoard, and Gandalf later recognized it as a weapon made in Gondolin during the First Age. Though forged as a knife for an Elf, it is large enough to serve as a short sword for a Hobbit.
Sting’s most famous magical feature is its blue radiance. The blade shines when Orcs or other nearby enemies approach, giving its bearer an early warning. Bilbo used it during his journey to Erebor, and later gave it to Frodo as part of his inheritance.
The weapon is closely connected with the destruction of Shelob’s webs and Frodo’s escape from danger in Mordor. A common mix-up is confusing Sting with other famous Middle-earth swords: Narsil belonged to Elendil, Andúril was reforged for Aragorn, and Glamdring was another Gondolin blade carried by Gandalf. Sting is also sometimes called a sword, but Tolkien’s text treats it as a knife or dagger made for Elves.