Running the GLA
Your rules-based adapter is now complete. Step through your template log file using the controls in the Extractor Result pane and validate its operation. When you're satisfied that everything is working properly, you can move on to running your adapter using the stand-alone GLA.
The GLA uses the settings you created in your adapter to read a log file and produce a CBE XML document. Listing 11 shows a small portion of the file my.adapter.
Listing 17. A snippet of the file my.adapater
<adapter:Adapter... <cc:ContextInstance charset="" continuousOperation="true" description="A context for daemon.log" isoCountryCode="" isoLanguageCode="" maximumIdleTime="120" pauseInterval="120" timezone="-0700" uniqueID="N05306B00AFF11DA8000AE8373D52828" year="2006"> <cc:Sensor description="Read the daemon.log" uniqueID="N057E8B10AFF11DA8000AE8373D52828" confidenceBufferSize="1024" fileFooterSize="0" maximumBlocking="10" type="SingleFileSensor"> <pu:Property propertyName="directory" propertyValue="/home/mstreicher/java-tptp-gla" /> <pu:Property propertyName="fileName" propertyValue="daemon.log" /> <sensor:SingleFileSensor directory="/home/mstreicher/java-tptp-gla" fileName="daemon.log"' /> </cc:Sensor> <ex:Extractor containsLineBreaks="false" description="Divide daemon.log into individual records" endPattern="$" includeEndPattern="false" includeStartPattern="false" lineBreakSymbol="" replaceLineBreaks="false" startPattern="^" uniqueID="N05AA7D00AFF11DA8000AE8373D52828" /> . </adapter:Adapter>
To run the GLA, you must first edit its script to point to where you installed it. Using your favorite editor, open the file gla.sh in GenericLogAdapter/bin. (If you followed the installation instructions verbatim, the file resides in ~/java/GenericLogAdapter/bin/gla.sh.) Find the line
GLA_HOME=/home/eclipse/GenericLogAdapter and change the path to point to the directory that contains your copy of the GLA. Again, if you followed the instructions verbatim, you would change the line to read
GLA_HOME=~/java/GenericLogAdapter. Save the file.
Next, find the file my.adapter in your Eclipse workspace under the directory My Adapter. On the test system, my.adapter was found in ~/workspace/My Adapter/my.adapter. To run the adapter, execute gla.sh, providing the path to your adapter file as the only argument:
% ~/java/GenericLogAdapter/bin/gla.sh ~/workspace/My\ Adapter/my.adapter
After a moment, the file emitter.log should appear in your home directory (or wherever you configured your file outputter to create the file).