Gather info about files in various hosts and generate csv file.
Im trying to capture all xml files in a set hosts that have the string “cc:”. Also I want to know the usage of this pattern in the xml files , so I try to grep them using shell module. My ultimate goal is to get a csv file with
HOSTNAME,FILE, GREP_OUTPUTLINES
For ex Host A might have two files dev.xml , perf.xml that has “cc:” usages in many lines:
Dev.xml
"<dependency location=\"cc://view/jrobin-1.5.9.1.jar\" name=\"robMon\" target_dir=\"${root}/vendor/\"/ />”
“<directive oscmd="ln -s ${root}/logs/ ${root}/httpd/servers/fluswaasd1-ahs1/htdocs" phase="post-install" dir=”cc:/view/text/def.txt” />”
Perf.xml
“<artifact location="cc://view/cli_metafile.1.3.0.xsd" target_dir="${root}/stage/" />”
<dependency location="cc://view/javamelody-1.39.0.jar" name="melMon" target_dir="${root}/vendor/"/>
Since these grep o/p gets captured in the results.stdout . I tried to write a jija2 template to loop over this and write them to a csv file. But it doesn’t seem to work.
Any ideas or suggestions on how I can achieve this??
Kindly help