Hi !
I’m pretty new to BigFix and I need to swap a character in my analysis results in order to interpret it with Splunk.
I’m basically listing all my Linux servers packages and versions with this property :
packages whose(if exists properties whose(it as string contains "currently installed of ") then (currently installed of it) else TRUE) of (if exists properties whose(it as string contains "debianpackage:") then debianpackages else if exists properties whose(it as string contains "rpm:") then rpms else ERROR "The operators are not defined.")
which results as a whole bunch of lines in this format: package : version
openssh-sftp-server: 1:7.2p2-4ubuntu2.6
libmcrypt4: 2.5.8-3.3
python3: 3.5.1-3
python3.5-minimal: 3.5.2-2ubuntu0~16.04.5
etc…
What I need to do is replace every semi-column “:” by pipes “|”
( “python3 | 3.5.1-3” as an example)
I’ve tried something like :
concatenation "|" of (substrings separated by ":" of (packages whose(if exists properties whose(it as string contains "currently installed of ") then (currently installed of it) else TRUE) of (if exists properties whose(it as string contains "debianpackage:") then debianpackages else if exists properties whose(it as string contains "rpm:") then rpms else ERROR "The operators are not defined."))as string)
or
packages whose(if exists properties whose(it as string contains "currently installed of ") then (currently installed of it) else TRUE) of (if exists properties whose(it as string contains "debianpackage:") then (concatenation "|" of (substrings separated by ":" of (debianpackages as string)) else if exists properties whose(it as string contains "rpm:") then rpms else ERROR "The operators are not defined.")
without success
Would you have any hint on how to achieve this ?
Many thanks !