Set quick fields to default, and then you can add your own via -f

dev
Eric Loyd 1 year ago
parent 592fcf2dee
commit 8fa76d3b89

@ -122,7 +122,7 @@ print_help() {
--help This text
--helpopt Show help for command options
--keyfile APIkeyFile="\$2"
-q|--quick Appends the following to -f: .host_name,.service_description,.current_state,.state_type,.problem_has_been_acknowledged (assumes servicestatus)
-q|--quick Sets -f to .host_name,.service_description,.current_state,.state_type,.problem_has_been_acknowledged (assumes servicestatus)
-Q Same as --quick but add -o c
-j|--jq moreJQ="\$2"
-v|--verbose verbose=\$((\$verbose + 1))
@ -365,7 +365,11 @@ case "$myAPIep" in
jq_add_contactgroup
;;
esac
[ -n "$myQuick" ] && myFields+=".host_name,.service_description,.current_state,.state_type,.problem_has_been_acknowledged"
if [ -n "$myQuick" -a -n "$myFields" ]; then
myFields=".host_name,.service_description,.current_state,.state_type,.problem_has_been_acknowledged,${myFields}"
elif [ -n "$myQuick" ]; then
myFields=".host_name,.service_description,.current_state,.state_type,.problem_has_been_acknowledged"
fi
[ -n "$myFields" ] && jq_get_fields
jqString+="$moreJQ"
do_debug 1 "jqString=$jqString"

Loading…
Cancel
Save