How to make custom user for by_ssh

Im using a master satellite client setup right now, i have 2 satellites. (This satellite works fine) but my other satellite is not able to give me any data from client because my first satellite has a different user in template. Basically First satellite usses root as user to do ssh checks and for satellite 2 i have a user called icinga, How to define check_by_ssh with a custom user

You need to add to your service definition:

vars.by_ssh_logname = …

im using by_ssh for services so i need to make this changes in the services files?

Yes, or even at your host object.