#!/bin/bash
# filename: parserQuery.sh
# author : joe gumke
# date : 12-7-15
# description : queries log decoders for parsers, and creates csv

fileLocation="/tmp/parserVersions"

for i in $(cat /root/scripts/applianceList/logDecoders); do
        ssh root@$i 'find /etc/netwitness/ng/envision/etc/devices/ -type f -regex '.*xml' | xargs grep xml=\"' > $fileLocation/$i.txt
        sed -i 's/\/etc\/netwitness\/ng\/envision\/etc\/devices\///' $fileLocation/$i.txt
        sed -i 's/[[:blank:]]//g' $fileLocation/$i.txt
        sed -i 's/\//,/' $fileLocation/$i.txt
        sed -i 's/\.xml:/\.xml,/' $fileLocation/$i.txt
done
