hammer command when used with --csv option to output the data in a single field, outputs certain fields in a JSON format rather than as a single field

Solution Verified - Updated -

Issue

  • Why are certain fields formatted as JSON rather than a single field when hammer command is used with --csv option to output the data?

  • Hammer command produces the output of certain fields in json format instead of a single field value as follows :

    # hammer --csv host info --name myhost.example.com --fields "Name,Content Information/Content view environments/Content view/Name,Content Information/Content view environments/Lifecycle environment/Name,Host Collections/Name,Host Group,Operating system/Operating System"
    
    Name,Host Group,Operating system::Operating System,Content view environments::Content view::1,Content view environments::Lifecycle environment::1
    myhost.example.com,,RedHat 9.2,"{""id""=>3, ""name""=>""RHEL8"", ""composite""=>false}","{""id""=>1, ""name""=>""Library""}"
    

Environment

  • Red Hat Satellite 6.14, 6.15, 6.16

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content