My understanding is that all of this info is in the objects.config file, and I have pulled that into an Excel sheet. I need to bring each field into it's own column so I can filter it, and in the file each field is a separate row, so the spreadsheet has literally hundreds of thousand of rows. I've tried a variety of Excel formulas, though I am no Excel expert. A simple filter for example to filter column B for host_name and copy all the host names in column C to a new sheet, do the same for contacts, etc could work, but the issue is that some services/hosts don't have that defined so then it's thrown off. I ran into the same issue with my other formulas.
I found this post which is promising, but when I attempt to run it, I get an unterminated string, syntax error. Command below:
Code: Select all
awk 'BEGIN{print "host_name,hostgroups,contacts,contact_groups"} /host_name/{v1=$2} /hostgroups/{v2=","$2} /contacts/{v3=","$2} /contact_groups/{v4=","$2} /}/{print v1","v2","v3,"v4; v1=v2=v3=v4""}' objects.txt > objectexport2.csv