I am using the below command and it is giving me the whole host lists in the environment, but i need for the particular host. Please suggest?
| metadata type=hosts index=*
The metadata command has only index and splunk_server (indexers/search peers) filter, so either you can filter your host information like this
| metadata type=hosts index=* | where host="YourHostHere"
OR use this to get data for just your host.
| tstats count as totalCount min(_time) as firstTime max(_time) as lastTime max(_time) as recentTime WHERE index=* host="YourHostHere" by host