many ways to go about it ...
see the output of the command and start exploring ...
heres a link to the doc that has more elaborated examples:
hope it helps
index=my_index* | metadata type=hosts
Error in 'metadata' command: This command must be the first command of a search.
The search job has failed due to an error. You may be able view the job in the Job Inspector.