I have a field FQ with the value as "ServerName.domain.com"
I want to get only the server name in another field.
Try this rex
|rex field=FQ "(?P<servername>^[^.]*)"
|rex field=FQ "(?<ServerName>[\w-]+)"
If you have any other characters in the servername , then you have to include that as well in the rex.