Reputation: 276
So I am trying to get filesystem sizes using a knife command as below. As is, I can see the sizes in kb; is there a way I can convert them to human readable values (Mb or Gb) in knife commands itself? Or may be parse and then convert? My First preference would be an in-line modification rather than converting it into a script. I am fetching many more values from the knife command , hence programmatically it would be a bit difficult
knife search node 'hostname:MyHostName' -a filesystem.by_mountpoint./apps.kb_size -a filesystem.by_mountpoint./apps.kb_used -Fjson
{
"results": 1,
"rows": [
{
"MyHostName": {
"filesystem.by_mountpoint./apps.kb_size": "1998672",
"filesystem.by_mountpoint./apps.kb_used": "760672"
}
}
]
}
Upvotes: 1
Views: 96