<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>NetLogger Blog</title>
	<atom:link href="http://acs.lbl.gov/NetLoggerBlog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://acs.lbl.gov/NetLoggerBlog</link>
	<description>1/2 baked ideas from the NL dev team</description>
	<lastBuildDate>Fri, 11 Sep 2009 14:36:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>xdrlib</title>
		<link>http://acs.lbl.gov/NetLoggerBlog/?p=62</link>
		<comments>http://acs.lbl.gov/NetLoggerBlog/?p=62#comments</comments>
		<pubDate>Fri, 11 Sep 2009 14:36:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CEDPS]]></category>

		<guid isPermaLink="false">http://acs.lbl.gov/NetLoggerBlog/?p=62</guid>
		<description><![CDATA[Thinking about how to shuffle log events between Python and other languages (e.g. Java), XDR seems like one possible solution. It would allow non-string data types (i.e. encode the timestamps as floats) and minimize parsing on the receiver. So I fooled around a little with python&#8217;s xdrlib. Pretty nice, although it assumes an RPC model [...]]]></description>
			<content:encoded><![CDATA[<p>Thinking about how to shuffle log events between Python and other languages (e.g. Java), XDR seems like one possible solution. It would allow non-string data types (i.e. encode the timestamps as floats) and minimize parsing on the receiver. So I fooled around a little with python&#8217;s xdrlib. Pretty nice, although it assumes an RPC model of one message at a time. I saw an interesting <a title="xdrlib feature request" href="http://bugs.python.org/issue461890" target="_blank">proposal to add a streaming read() function</a> on the Python bug tracker, but that seems to me like overkill (especially since I intend to do my reading from Java).</p>
<p>Instead, I used a simple buffer length header. Here are the <code>write_buf()</code>, <code>read_buf()</code> functions. I&#8217;m using files here, but sockets should be the same (except for the usual issues with read() not returning as many bytes as you want).</p>
<pre>def write_buf(ofile, p):
    """Write the contents of xdrlib.Packer, p,
    to ofile with a 4-byte header with the buffer size.
    """
    buf = p.get_buffer()
    buflen = len(buf)
    p.reset()
    p.pack_int(buflen)
    ofile.write(p.get_buffer())
    ofile.write(buf)
    return buflen

def read_buf(ifile, p):
    """Read a buffer from ifile into the xdrlib.Unpacker, p,
    using the 4-byte header to determine the data buffer size.
    """
    hdr = ifile.read(4)
    if not hdr:
        return 0
    p.reset(hdr)
    bufsize = p.unpack_int()
    data = ifile.read(bufsize)
    p.reset(data)
    return bufsize</pre>
]]></content:encoded>
			<wfw:commentRss>http://acs.lbl.gov/NetLoggerBlog/?feed=rss2&amp;p=62</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>pylint</title>
		<link>http://acs.lbl.gov/NetLoggerBlog/?p=59</link>
		<comments>http://acs.lbl.gov/NetLoggerBlog/?p=59#comments</comments>
		<pubDate>Tue, 30 Jun 2009 04:39:50 +0000</pubDate>
		<dc:creator>dang</dc:creator>
				<category><![CDATA[CEDPS]]></category>
		<category><![CDATA[pylint]]></category>

		<guid isPermaLink="false">http://acs.lbl.gov/NetLoggerBlog/?p=59</guid>
		<description><![CDATA[Although I&#8217;ve used pychecker for a while to speed up the Python development process, I never got into pylint. But I think it&#8217;s a good time now to go through and modernize &#38; streamline the Python codebase a bit. So I&#8217;ll be posting pylint usage notes here.
First things first: to get pylint, go to the [...]]]></description>
			<content:encoded><![CDATA[<p>Although I&#8217;ve used pychecker for a while to speed up the Python development process, I never got into pylint. But I think it&#8217;s a good time now to go through and modernize &amp; streamline the Python codebase a bit. So I&#8217;ll be posting pylint usage notes here.</p>
<p>First things first: to get pylint, go to the <a title="pylint home page" href="http://www.logilab.org/project/pylint" target="_blank">pylint home page</a> and install it in the usual way.</p>
<p>Then after you set up PYTHONPATH as you would to import a module, you can run it on code. So far, I have only used it in the most basic way</p>
<ul>
<li>Check errors: pylint -e {module}.py</li>
<li>Full report: pylint {module}.py</li>
</ul>
<p>I understand there&#8217;s a great deal of customization possible, but I&#8217;m going to live with the defaults for a while and see where that gets me. Some things in my code that in general need to be changed are:</p>
<ul>
<li>methods named doSomething() should be renamed do_something(). I like this convention better anyways.</li>
<li>I use a global &#8216;log&#8217; object; pylint wants globals like that to be capitalized. I tried it and kinda like it. So, log.info(&#8221;foo&#8221;) becomes LOG.info(&#8221;foo&#8221;)</li>
<li>Short variable names generate warnings. This is particularly evident in exception handling, where I use the variable &#8216;E&#8217; for the exception object. I think it is fine to change this to &#8216;err&#8217;.</li>
<li>Undocumented methods generate warnings. No problem there.</li>
<li>Instance attributes initialized outside the constructor. This is just bad practice, so thanks pylint.</li>
</ul>
<p>Look for the &#8216;pylint&#8217; tag for updates</p>
]]></content:encoded>
			<wfw:commentRss>http://acs.lbl.gov/NetLoggerBlog/?feed=rss2&amp;p=59</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>NCSA / OSG trial deployment of NetLogger Pipeline</title>
		<link>http://acs.lbl.gov/NetLoggerBlog/?p=57</link>
		<comments>http://acs.lbl.gov/NetLoggerBlog/?p=57#comments</comments>
		<pubDate>Thu, 04 Jun 2009 20:52:29 +0000</pubDate>
		<dc:creator>ksb</dc:creator>
				<category><![CDATA[CEDPS]]></category>

		<guid isPermaLink="false">http://acs.lbl.gov/NetLoggerBlog/?p=57</guid>
		<description><![CDATA[Over the past few days, Jim Basney and I worked through the, currently manual, steps of getting a pipeline running collecting info about his test OSG cluster.  The idea is to have NetLogger become a VDT package for site admins to monitor the security of their site.
There were a few small hiccups but for the [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past few days, Jim Basney and I worked through the, currently manual, steps of getting a pipeline running collecting info about his test OSG cluster.  The idea is to have NetLogger become a VDT package for site admins to monitor the security of their site.</p>
<p>There were a few small hiccups but for the most part it went well.  Jim wrote it up <a href="https://twiki.grid.iu.edu/bin/view/Security/Logging2009" target="_blank">here</a>.  Now, we&#8217;ve got some bugs to fix and perhaps a feature or two to add.</p>
]]></content:encoded>
			<wfw:commentRss>http://acs.lbl.gov/NetLoggerBlog/?feed=rss2&amp;p=57</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Connecting to R from Java</title>
		<link>http://acs.lbl.gov/NetLoggerBlog/?p=54</link>
		<comments>http://acs.lbl.gov/NetLoggerBlog/?p=54#comments</comments>
		<pubDate>Fri, 16 Jan 2009 16:07:09 +0000</pubDate>
		<dc:creator>dang</dc:creator>
				<category><![CDATA[CEDPS]]></category>
		<category><![CDATA[pegasus]]></category>

		<guid isPermaLink="false">http://acs.lbl.gov/NetLoggerBlog/?p=54</guid>
		<description><![CDATA[Background: NetLogger uses R for analysis, but the Pegasus group has a Java GUI. They want to re-use the R code directly by connecting to R from Java.
I think this project (JRI) has what&#8217;s needed:
home: http://www.rforge.net/JRI/
download page: http://www.rforge.net/JRI/files/
javadoc page:http://www.rosuda.org/R/nightly/JavaDoc/
It compiled and seemed to work on Mac OSX (Jaguar, with Developer tools installed).
If we just want [...]]]></description>
			<content:encoded><![CDATA[<p>Background: NetLogger uses R for analysis, but the Pegasus group has a Java GUI. They want to re-use the R code directly by connecting to R from Java.</p>
<p>I think this project (JRI) has what&#8217;s needed:</p>
<p>home: http://www.rforge.net/JRI/<br />
download page: http://www.rforge.net/JRI/files/<br />
javadoc page:http://www.rosuda.org/R/nightly/JavaDoc/</p>
<p>It compiled and seemed to work on Mac OSX (Jaguar, with Developer tools installed).</p>
<p>If we just want graphs from R, the basic interface is all we&#8217;d need. Here&#8217;s an example of how I ran a little test program (below) from inside the unzipped tarball. When it finishes you can look at the output in &#8220;/tmp/nlr.pdf&#8221;.</p>
<blockquote><p>
<code><br />
JAVA_HOME=/Library/Java/Home<br />
R_HOME=/Library/Frameworks/R.framework/Resources<br />
javac -classpath src/JRI.jar examples/nlr.java<br />
java -cp src/JRI.jar:.:examples nlr<br />
(Output)<br />
creating Rengine<br />
Rengine created, waiting for R<br />
R is running<br />
stopping Rengine<br />
</code></p></blockquote>
<p>Test program:</p>
<p><code><br />
import org.rosuda.JRI.Rengine;<br />
import org.rosuda.JRI.RMainLoopCallbacks;</p>
<p>class EmptyCallbacks implements RMainLoopCallbacks {<br />
    static void print(String s) { System.err.println(s); }</p>
<p>    public void   rWriteConsole (Rengine re, String text, int oType) {<br />
        //print("Console: " + text);<br />
        return;<br />
    }<br />
    public void   rBusy         (Rengine re, int which) { print("busy"); return; }<br />
    public String rReadConsole  (Rengine re, String prompt, int addToHistory) { print("read console"); return ""; }<br />
    public void   rShowMessage  (Rengine re, String message) { print("Message: " + message); return; }<br />
    public String rChooseFile   (Rengine re, int newFile) { print("choose file"); return ""; }<br />
    public void   rFlushConsole (Rengine re)  { print("flush console"); return; }<br />
    public void   rSaveHistory  (Rengine re, String filename) { print("save hist"); return; }<br />
    public void   rLoadHistory  (Rengine re, String filename) { print("load hist"); return; }<br />
}</p>
<p>public class nlr {<br />
    static void print(String s) { System.err.println(s); }<br />
    static void eval(Rengine r, String s) { r.eval(s, false); }</p>
<p>    public static void main(String[] args) {<br />
        if (!Rengine.versionCheck()) {<br />
            System.err.println("** Version mismatch - Java files don't match library version.");<br />
            System.exit(1);<br />
        }</p>
<p>        print("creating Rengine");</p>
<p>        Rengine re = new Rengine(args, false, new EmptyCallbacks());</p>
<p>        print("Rengine created, waiting for R");</p>
<p>        // the engine creates R is a new thread, so we should wait until it's ready<br />
        if (!re.waitForR()) {<br />
            System.out.println("Cannot load R");<br />
            return;<br />
        }</p>
<p>        print("R is running");</p>
<p>        try {<br />
            eval(re, "data(iris)");<br />
            eval(re,"pdf('/tmp/nlr.pdf')");<br />
            eval(re, "print(stripchart(iris[, 1:4], method = 'stack', " +<br />
                    "pch = 16, cex = 0.4, offset = 0.6))");<br />
            eval(re, "dev.off()");<br />
        } catch (Exception e) {<br />
            print("ERROR: "+e);<br />
            e.printStackTrace();<br />
        }</p>
<p>        print("stopping Rengine");</p>
<p>        re.end(); // stop the Rengine</p>
<p>        return;<br />
    }<br />
}<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://acs.lbl.gov/NetLoggerBlog/?feed=rss2&amp;p=54</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>updated bestman (SRM) parser and R code</title>
		<link>http://acs.lbl.gov/NetLoggerBlog/?p=50</link>
		<comments>http://acs.lbl.gov/NetLoggerBlog/?p=50#comments</comments>
		<pubDate>Thu, 11 Dec 2008 17:02:16 +0000</pubDate>
		<dc:creator>dang</dc:creator>
				<category><![CDATA[CEDPS]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[SRM]]></category>

		<guid isPermaLink="false">http://acs.lbl.gov/NetLoggerBlog/?p=50</guid>
		<description><![CDATA[I&#8217;ve updated the bestman parser, which was previously trying to link together the events by a combination of path and thread-id, to do a much simpler operation using the request identifier (rid). This is a big improvement over the previous version linked to here, which wasn&#8217;t trying to link them together at all (!) In [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve updated the bestman parser, which was previously trying to link together the events by a combination of path and thread-id, to do a much simpler operation using the request identifier (rid). This is a big improvement over the previous version linked to here, which wasn&#8217;t trying to link them together at all (!) In addition to making the code simpler and more reliable, it also should help decoding the raw output as the rid has some information about the user and type of request inside it.</p>
<p>The new code is in subversion and should be in the development release tomorrow (Dec 12). I also updated the R code to use the new name in the &#8216;ident&#8217; table (&#8217;req&#8217; instead of &#8216;guid&#8217;). See the <a href="http://acs.lbl.gov/NetLoggerBlog/?p=38">previous post</a> for details on getting the code out of subversion, running the parser and loader, etc.</p>
<p>You can get a new  <a href="http://www.cedps.net/images/d/d7/Bestman_pdsfgrid5_11DEC2008.bp.bz2">sample logfile</a> off the NetLogger Wiki on the SRM/BeStMan page.</p>
]]></content:encoded>
			<wfw:commentRss>http://acs.lbl.gov/NetLoggerBlog/?feed=rss2&amp;p=50</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>parsing SRM logs</title>
		<link>http://acs.lbl.gov/NetLoggerBlog/?p=38</link>
		<comments>http://acs.lbl.gov/NetLoggerBlog/?p=38#comments</comments>
		<pubDate>Sat, 06 Dec 2008 02:06:06 +0000</pubDate>
		<dc:creator>dang</dc:creator>
				<category><![CDATA[CEDPS]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[SRM]]></category>

		<guid isPermaLink="false">http://acs.lbl.gov/NetLoggerBlog/?p=38</guid>
		<description><![CDATA[I&#8217;ve updated the SRM parser in an attempt to more easily link together the various events with a unique identifier (which I&#8217;m putting in the &#8216;guid&#8217; attribute).
To get the newest code, follow the cookbook instructions for getting the code from subversion and setting up your environment.
Then, you can test out the parser on this sample [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve updated the SRM parser in an attempt to more easily link together the various events with a unique identifier (which I&#8217;m putting in the &#8216;guid&#8217; attribute).</p>
<p>To get the newest code, follow the cookbook <a href="http://acs.lbl.gov/NetLogger-releases/doc/4.1.1a/cookbook.html#toc4">instructions for getting the code</a> from subversion and setting up your environment.</p>
<p>Then, you can test out the parser on this <a href="http://www.cedps.net/images/3/38/Bestman_pdsfgrid5.txt">sample log</a>. After saving the log to some file we&#8217;ll just call $LOGFILE, do this:</p>
<p><code> nl_parser -m bestman -p version=2 $LOGFILE<br />
</code></p>
<p>This should print, to standard output, 14 lines of pretty unreadable log output. However, if you save this in a file, say $LOGFILE2, you could now load it into a database with <em>nl_loader</em>. Here&#8217;s an example of how to load it into an sqlite3 database (file) called $DBFILE &#8212; no extra installation is required for SQLite.</p>
<p><code>nl_parser -m bestman -p version=2 $LOGFILE &gt; $LOGFILE2<br />
DBFILE=example.sqlite<br />
nl_loader -u sqlite://$DBFILE -C -i $LOGFILE2<br />
</code></p>
<p>To verify that there actually is something in the database, you can do a simple query like this:<br />
<code>sqlite3 $DBFILE "select * from event"<br />
# Output:<br />
1|207deecdec2f9a3f0c8d33ccd7298072|1225524876.722|srm.server.copy.in|2|4<br />
2|0b468528bc886b71176a1f4bb1f8a0a4|1225524876.731|srm.server.list|2|4<br />
3|106f4156e5517858ec0f4684dfe73a9d|1225524876.731|srm.server.req|0|4<br />
4|597e7ba2a8cb6383cc871e383d05e350|1225524876.732|srm.server.req.to.queued|2|4<br />
5|82973ccd386f6cee9ebf5fe33ef71e69|1225524876.732|srm.server.req.to.scheduled|2|4<br />
6|f8fa6278a718101c9a4a4482744f5548|1225524876.733|srm.server.copy.out|2|4<br />
7|0a50c7178490b8f8904e52ea863afd7c|1225524876.894|srm.server.req.to.status|2|4<br />
8|014e3fef040a8e048d09e059ae7987b4|1225524876.894|srm.server.TSRMRequestCopyToRemote.upload|2|4<br />
9|ab2bb06914ce590266bca5117c11ed91|1225524876.894|srm.server.req.to.status|2|4<br />
10|d16c585253b2e420be8322fc64f759fc|1225524876.895|srm.server.tx.push|0|4<br />
11|7b7370e35a8917ae5f976dc6f4f611f9|1225524876.895|srm.server.tx.push.size|2|4<br />
12|dc1d0b07b1b404be2be3c2a7ddf23148|1225524935.733|srm.server.tx.push|1|4<br />
13|ee8bc3e776910fae76f3ec310eaba879|1225524935.733|srm.server.req.to.status|2|4<br />
14|d2c23970199473453820ac07aec5eeb7|1225524935.733|srm.server.req.to|1|4<br />
</code></p>
<p>You could also try out the R code in <em>trunk/R/bestman.R</em> in the NetLogger subversion repository. Just looking at the contained SQL should give you an idea how this  data can be queried and joined together on those &#8216;guid&#8217; attributes so you can look at all the information from one transfer together. Note that there are still some issues with getting the same GUID for all the events, and in particular the &#8216;queued&#8217; event doesn&#8217;t seem to get the same GUID as the rest.</p>
<p>If you want to look at the source code for the parser itself, look under <em>trunk/python/netlogger/parsers/modules/bestman.py</em> and in particular the code section that mentions &#8220;version 2&#8243;. Hopefully it&#8217;s reasonably clear how events are being mapped and processed.</p>
]]></content:encoded>
			<wfw:commentRss>http://acs.lbl.gov/NetLoggerBlog/?feed=rss2&amp;p=38</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Script to indent R code</title>
		<link>http://acs.lbl.gov/NetLoggerBlog/?p=35</link>
		<comments>http://acs.lbl.gov/NetLoggerBlog/?p=35#comments</comments>
		<pubDate>Tue, 02 Dec 2008 00:18:56 +0000</pubDate>
		<dc:creator>dang</dc:creator>
				<category><![CDATA[CEDPS]]></category>
		<category><![CDATA[R]]></category>

		<guid isPermaLink="false">http://acs.lbl.gov/NetLoggerBlog/?p=35</guid>
		<description><![CDATA[I was looking for a way to indent my R code, since the R auto-packaging command inserted a bunch of hard tabs and anyways the code was messy.
I found  this page describing a way to do it with ESS (Emacs Speaks Statistics). So, I downloaded ESS from the ESS homepage and adapted the script [...]]]></description>
			<content:encoded><![CDATA[<p>I was looking for a way to indent my R code, since the R auto-packaging command inserted a bunch of hard tabs and anyways the code was messy.</p>
<p>I found  <a href="http://gragusa.wordpress.com/2007/11/11/textmate-emacs-like-indentation-for-r-files/">this page</a> describing a way to do it with ESS (Emacs Speaks Statistics). So, I downloaded ESS from <a href="http://ess.r-project.org/">the ESS homepage</a> and adapted the script slightly to be a simple shell-script.</p>
<p><code>#!/bin/sh<br />
# Use emacs ESS pkg to indent R file<br />
# Dan Gunter, Dec 2008<br />
function usage () {<br />
    printf "Indent R file with Emacs ESS package.\n"<br />
    printf "Usage: $0 FILE\n"<br />
    exit 1<br />
}<br />
f=$1<br />
shift<br />
if test "x$f" = x -o "x$f" = "x-h"; then<br />
    usage<br />
fi<br />
emacs -batch \<br />
-eval '(load "/Users/dang/local/lib/emacs/ess-5.3.8/lisp/ess-site")' \<br />
-f R-mode \<br />
-eval '(insert-file "'${f}'")' \<br />
-eval '(set-visited-file-name "'"${f}"'")' \<br />
-eval '(indent-region (point-min) (point-max) nil)' \<br />
-f save-buffer \<br />
2>/dev/null<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://acs.lbl.gov/NetLoggerBlog/?feed=rss2&amp;p=35</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>packaging R scripts</title>
		<link>http://acs.lbl.gov/NetLoggerBlog/?p=33</link>
		<comments>http://acs.lbl.gov/NetLoggerBlog/?p=33#comments</comments>
		<pubDate>Tue, 25 Nov 2008 00:43:37 +0000</pubDate>
		<dc:creator>dang</dc:creator>
				<category><![CDATA[CEDPS]]></category>
		<category><![CDATA[R]]></category>

		<guid isPermaLink="false">http://acs.lbl.gov/NetLoggerBlog/?p=33</guid>
		<description><![CDATA[One of the tedious sub-tasks necessary for distributing the analysis code I use is to package up the R programs (not really &#8220;scripts&#8221; as it&#8217;s a full-featured language) into something that can be run from the command-line.
R does not have the best interface to this, but I found online at a script to run R programs [...]]]></description>
			<content:encoded><![CDATA[<p>One of the tedious sub-tasks necessary for distributing the analysis code I use is to package up the R programs (not really &#8220;scripts&#8221; as it&#8217;s a full-featured language) into something that can be run from the command-line.</p>
<p>R does not have the best interface to this, but I found online at <a href="http://www.bgl.nu/~glouis/setR.html">a script to run R programs using #! syntax</a> that uses the R startup sequence to &#8220;fool&#8221; the interpreter into running your script as part of its initial commands. I tweaked this a bit, to use <code>printf</code> instead of <code>echo</code> and to automatically quit the interpreter after the called script returns, and then checked it into subversion as &#8220;runR&#8221; in the trunk/R directory.</p>
<p>But how to take my current files of various functions and make them into a &#8220;real&#8221; executable? What I really need is the equivalent of Python&#8217;s optparse, or at least getopt. Time to do some more hunting.. </p>
]]></content:encoded>
			<wfw:commentRss>http://acs.lbl.gov/NetLoggerBlog/?feed=rss2&amp;p=33</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Poor man&#8217;s pipeline</title>
		<link>http://acs.lbl.gov/NetLoggerBlog/?p=30</link>
		<comments>http://acs.lbl.gov/NetLoggerBlog/?p=30#comments</comments>
		<pubDate>Sat, 15 Nov 2008 05:09:35 +0000</pubDate>
		<dc:creator>ksb</dc:creator>
				<category><![CDATA[CEDPS]]></category>

		<guid isPermaLink="false">http://acs.lbl.gov/NetLoggerBlog/?p=30</guid>
		<description><![CDATA[As a short-cut to getting a full nl_pipeline running (because I suck) here&#8217;s what I just did to load in from scratch all the SRM logs and start a &#8220;poor man&#8217;s pipeline&#8221; to pick up events as they come in:
# Start with a completely clean DB
mysql&#62; drop database test;
mysql&#62; create database test;

# Load in existing [...]]]></description>
			<content:encoded><![CDATA[<p>As a short-cut to getting a full nl_pipeline running (because I suck) here&#8217;s what I just did to load in from scratch all the SRM logs and start a &#8220;poor man&#8217;s pipeline&#8221; to pick up events as they come in:</p>
<pre># Start with a completely clean DB
mysql&gt; drop database test;
mysql&gt; create database test;

# Load in existing events from the existing log file (note the -C passed to nl_loader to create the schema)
$ grep " event_srm_log " pdsfgrid5.nersc.gov.vdt.log | \
  nl_parser -m bestman -e '\S+ \S+ \S+ ' -m bestman -p version=2 | \
  nl_loader -C -u mysql://localhost -p db=test
# This took about 35 minutes to complete, yielding some 220K events in the DB

# Now the pipeline:
$ tail -f pdsfgrid5.nersc.gov.vdt.log | \
  grep " event_srm_log " | \
  nl_parser -m bestman -e '\S+ \S+ \S+ ' -m bestman -p version=2 | \
  nl_loader -u mysql://localhost -p db=test</pre>
<p>I&#8217;ve also done this for gram events for the tech-x guys&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://acs.lbl.gov/NetLoggerBlog/?feed=rss2&amp;p=30</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SQL code to get GRAM job ID from URL</title>
		<link>http://acs.lbl.gov/NetLoggerBlog/?p=26</link>
		<comments>http://acs.lbl.gov/NetLoggerBlog/?p=26#comments</comments>
		<pubDate>Sat, 15 Nov 2008 00:55:19 +0000</pubDate>
		<dc:creator>dang</dc:creator>
				<category><![CDATA[sc08-techx-demo]]></category>

		<guid isPermaLink="false">http://acs.lbl.gov/NetLoggerBlog/?p=26</guid>
		<description><![CDATA[
mysql> use techx;
mysql> select trim(trailing '.' from replace(substring_index(gridJobID, '/', -3), '/', '.')) as 'gram_id' from Jobs;
+---------------------+
&#124; gram_id               &#124;
+---------------------+
&#124; 14094.1226615002 &#124;
&#124; NULL                   &#124;
&#124; 16255.1226616087 [...]]]></description>
			<content:encoded><![CDATA[<p><code><br />
mysql> use techx;<br />
mysql> select trim(trailing '.' from replace(substring_index(gridJobID, '/', -3), '/', '.')) as 'gram_id' from Jobs;</p>
<p>+---------------------+<br />
| gram_id               |<br />
+---------------------+<br />
| 14094.1226615002 |<br />
| NULL                   |<br />
| 16255.1226616087 |<br />
| 19674.1226619065 |<br />
| 22903.1226620711 |<br />
| 28114.1226625017 |<br />
| 29889.1226625489 |<br />
| NULL                   |<br />
| 11191.1226683572 |<br />
| 25930.1226693279 |<br />
| 30603.1226697028 |<br />
| 7016.1226699246   |<br />
+-------------------- -+<br />
12 rows in set (0.00 sec)<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://acs.lbl.gov/NetLoggerBlog/?feed=rss2&amp;p=26</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
