Hammer cli - command to see servers with comment

Hi Everyone,
I am trying to get list with servers that have a comment.
Does is possible? via Hammer command

Thanks in advanced :slight_smile:

All hosts have comments. You can search the comment field with the usual string operators.

I guess, you want to list all hosts with some text in the comment field. You could search for comment != "".

With this command I sow servers that have a comment, but I didn’t sow the comment any changes to see also what I wrote in the comment??
hammer host list --search ‘comment != “”’ --fields “Id,Name,Comment”

You can only see a limited set of fields with list. You have to use show on each host:

# hammer --csv --no-headers host list --search 'comment != ""' --fields "Id" | while read id
    hammer host show --id $id --fields "Id,Name,Additional info/comment"

Thank you :slight_smile:

The scoped_search syntax for this is a bit odd, but it should work: You can use null? and set? for any field. So

set? comment

should be what you’re looking for.