How to get the spotlight location from the material used in the light function

Using blue print in the material (light function) to extract the spotlight location and change the materiel (light function) as a function of the spotlight position.

Hm, your text makes no sense to me. Could you explain what exactly you want to do? You want to change the position of spotlight from blueprints? Or?

I have a spotlight component with light function, the light function is implemented by material as shown in the attached image. I plan to add a node that can get the position of the spotlight.

Only way you can achieve this is to create some blueprint with you light and set some vector parameter value in material parameter collection (MPC) which will be those light position, direction or something, and use that MPC in you material.