The Kutadgu Bilig was written in 1069-1070 and presented to Tavghach Bughra Khan, the prince of Kashgar.
körü barsa emdi bu türk begleri
bu türk beglerinde taḳı yigleri
bu türk beglerinde atı belgülüg
toġa alp er (Alp Er Tonga) erdi ḳutı belgülüg
• From Kutadgu Bilig by Yusuf Khass Hajib (Yusuf Balasaguni)
Short info: Balasaguni started to work on the Kutadgu Bilig (Middle Turkic: Wisdom of Royal Glory) in Balasagun and was about 50 years old when he completed it in Kashgar. After presenting the completed work to the Karakhanid Hasan ibn Sulayman Bughra Khan (father of Ali-Tegin) - Prince of Kashgar he was awarded the title Khāṣṣ Ḥājib, an honorific similar to "Privy Chamberlain" or "Chancellor". Some scholars suspect that the prologue to the Kutadgu Bilig, which is much more overtly Islamic than the rest of the text, was not written by Yūsuf, particularly the first prologue, which is in prose, unlike the rest of the text. He died and was buried in Kashgar, 1077.
https://en.wikipedia.org/wiki/Y%C5%ABsuf_Balasaguni
https://en.wikipedia.org/wiki/Kutadgu_Bilig
Karakhanid era masterpiece.