Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/jq -Sf
- def chef_fields:
- # special field adjustments go here
- .
- ;
- .rows|
- map(select(.name)) | sort_by(.name) |
- map(chef_fields |
- [
- .automatic,
- .automatic.dmi,
- . # the current data
- ] | add |
- {
- labels:
- {
- kernel_release: .kernel.release,
- os,
- os_version,
- platform,
- platform_version,
- platform_family,
- },
- targets: ["\(.name):9100"]
- # remove all empty or null labels
- } | delpaths([path(.labels[]| select(. == "" or . == null))])
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement