Parsing csv file by computer name to set client setting

Hello, I am attempting to parse a csv file, find the matching record by computer name and set a client setting with the values associated with that record.
My csv file has 4 comma seperated fields:
BFIXDBPROD,BFixDBProd,94410943001e3f90a83ff344d3a8619783d913ded5,141877
BFIXREPO,BFixRepo,94424349c7502ef224c1a74b7bb4d802a82ffaa790,141994
.
.

I am attempting find the corresponding record by locating the csv record matching computer name and then set variable SRVID to the 3rd column. Then set client setting based on that.

The the parameter action is failing.
So here is what I have do far:

// Prefetch cmdb-bigfix csv file
prefetch bigfix_update_file sha1:ce9e9b9ea1f27b3da2f828ef059e85bfb624f44c size:79709 http://10.15.100.100/repo/yum/bigfix/bigfix_update_file sha256:fd764aea4bec4830be12d464dca7204488b0ee25db71be78464d51af99d9f2e9

parameter ā€œSRVIDā€= "{ ( unique values of (it as trimmed string) of tuple string items 3 of concatenations ā€œ, " of substrings separated by ā€œ,ā€ of it ) of lines whose( exists (it as trimmed string) whose(it is contained by set of (it as string) of name of bes computers) of following text of last ā€œ,ā€ of it ) of download file ā€œbigfix_update_fileā€ }ā€

// setting ā€œ_CMDB_Srv_RecIDā€="{ parameter ā€œSRVIDā€ }" on ā€œ{parameter ā€œaction issue dateā€ of action}ā€ for client
// setting ā€œ_CMDB_AssetTagā€="{ parameter ā€œASSETTAGā€ }" on ā€œ{parameter ā€œaction issue dateā€ of action}ā€ for client

Thanks for any help,
Terry

The ā€˜bes computersā€™ inspector doesnā€™t exist in client relevance, itā€™s only available in session relevance (i.e. a dashboard, web report, or API call that is communicating to the root server and reading ā€˜bes computersā€™ from the database).

Looks like youā€™re already handling the fact that ā€˜tuple string itemsā€™ requires both a comma and a space together as the delimiter.

Start by making sure you can identify the correct line - Iā€™d start in the debugger with something like

lines whose (preceding text of first "," of it as lowercase = computer name as lowercase) of file "c:\temp\test.txt"

I expect that would get you the one line matching your hostname. From there getting the third value could be something like

parameter "SRVID"="{unique values of (tuple string items 3 of concatenation ", " of substrings separated by "," of it as trimmed string) of lines whose (preceding text of first "," of it as lowercase = computer name as lowercase)}"

1 Like