I'm trying to figure out an easy way of putting a Jenkins config (config.xml) file into the directory where it's expecting it to be, in the hope that this will cause Jinks to use the correct log parse rules when running jobs. I can create a generic config file, but I want to make sure that it doesn't have the wrong Jenkins build number in it. Once I have the right build number from the current Jenkins instance, I'll be able to pass it as a parameter to an XSLT transformation. Here's one approach which works:
wget -O /tmp/jinks.html http://localhost:8080 JINKSBUILD=`grep -oP '(?<=Jenkins ver\. )(1.[0-9\.]+)(?=</a>)' /tmp/jinks.html`
I'm also going to investigate the option of using the Jenkins CLI interface.