I've been expanding my Windows Server audit script and changed it a bit. The custom ps object which contains all the server information is converted to json and i'm sending it to NLS . The problem is that some fields have an array of objects in it giving results like these in a field: (DNS cache)
Code: Select all
{"Name":" urladdress01","Section":" Answer","TTL":" 14","Type":" 1","Length":" 4","HostRecord":" 77.77.17.68"}, {"Name":" urladdress02","Section":" Answer","TTL":" 594","Type":" 1","Length":" 4","HostRecord":" 77.77.98.45"}, {"Name":" urladdress03","Section":" Answer","TTL":" 14","Type":" 1","Length":" 4","HostRecord":" 77.77.17.133"}Code: Select all
{"ComputerName":"server1","Name":"7-Zip 9.20 (x64 edition)","Publisher":"Igor Pavlov","InstallDate":"20150331","EstimatedSize":4.5,"Version":"9.20.00.0","Wow6432Node":null}, {"ComputerName":"server1","Name":"VMware Tools","Publisher":"VMware, Inc.","InstallDate":"20141113","EstimatedSize":54.6,"Version":"9.0.12.35149","Wow6432Node":null}, {"ComputerName":"server1","Name":"Microsoft Visual C++ 2008 Redistributable - x64 9.0.30729.6161","Publisher":"Microsoft Corporation","InstallDate":"20141113","EstimatedSize":13.2,"Version":"9.0.30729.6161","Wow6432Node":null}, {"ComputerName":"server1","Name":"NSClient++ (x64)","Publisher":"MySolutions NORDIC","InstallDate":"20150202","EstimatedSize":60.9,"Version":"0.4.3.127","Wow6432Node":null}Any tip what would be the best way to handle something like this in nls? Most of the fields which contain one value are very nicely imported. Created a Reactor event chain for it and I'm planning to run it every day on all our Windows server, effectively creating a daily audit in NLS for each server. i'm just looking for a better way to import the installed software and dnscacheobjects and show them. I had no experience with arrays in a field. I was thinking to make a separate json export for each installed software, but I'm not sure if there is no better way to handle it, as I'd prefer to keep the installed software in the same export as the other audit info.
EDIT:
Things that popped up where:
1) Send separate json for each element in the array, for example for each installed software => This would create a lot of nls log entries for each audit
2) Create a field in ps starting with the name of the software and send that to nls, for example installed_software_7-zip_version, installed_software_nsclient_version, same for size, installdate etc.. => This would create a massive amount of fields though
3) Leave the json array in the field as it is
Grtz
Willem