Skip to content

find examples

Oliver Gaida edited this page Sep 11, 2020 · 14 revisions
  • csv output with fieldseperator ;

rusdc find nr '[456]%sap' name,z_project --format mlr --mlr_format "csv --ofs ';'"

the optional 'mlr_format' will be attached to --o at the mlr-commandline. So "csv --ofs ';'" will end up with miller-command: mlr --ijson --ocsv --ofs ';'

  • find CIs with specific Childs

finds all Server with z_project.name starting with 123456, second search all childs with a name starting with Linux

rusdc find nr "z_project.name like '123456%' and class.type"\
" in ('Server', 'Virtueller Server') and delete_flag.sym = 'active'" \
name --format mlr | tee 123456_server

for ci in $(cat 123456_server | sed '1 d'); do rusdc find hier \
"parent.name = '$ci' and child.name like 'Linux%'" \
parent --format mlr | sed '1 d' | head -1 ; done | tee 123456_server_Linux
  • bash-function for finding a CI by a part of its name

be aware of perls lowercase for a better look

function find_ci(){
  rusdc find nr "name like '%"$1"%'" name,description \
  --format mlr --mlr_format json | perl -ne 'print(lc($_))' |sort
}
  • bash-function for finding a contact by a given part of its name and optional a part of its email address

function find_cnt(){
  name=$1
  dom=$2
  rusdc find cnt "last_name like '%${name}%' and email_address like '%${dom}%'" \
  last_name,first_name,email_address,phone_number,mobile_phone --format mlr
}
## in action:
find_cnt aid sycor
last_name first_name email_address         phone_number  mobile_phone
Gaida     Oliver     Oliver.Gaida@sycor.de +49....       +49....
  • find incidents of a contact by email_address

rusdc find in \
"assignee.email_address = 'Oliver.Gaida@sycor.de' and status.sym in "\
"('Service pending','Work in progress.','Customer Pending','Open','Hold','Resolved')" \
ref_num,z_project,summary,status,call_back_date,affected_resource,orig_user_organization \
--format mlr
  • show activity-log-entries of a changeorder

function show_changeorder_activities(){
  rusdc find chgalg "change_id.chg_ref_num = '$1'" \
  call_req_id,action_desc,analyst,description,time_stamp,type \
  --format mlr --mlr_format xtab
}
  • whereclause sql-like - you can use is null for undefined attributes and not like for negation:

rusdc find nr "class.type = 'server' and z_chg_mgr_1 is null"\
" and name not like 'xy%'" name,z_chg_mgr_1 --format mlr 

Clone this wiki locally