Project

General

Profile

1
<!--
2
  * metacatread.html
3
  *
4
  *      Authors: Jivka Bojilova
5
  *    Copyright: 2000 Regents of the University of California and the
6
  *               National Center for Ecological Analysis and Synthesis
7
  *  For Details: http://www.nceas.ucsb.edu/
8
  *      Created: 2000 April 5
9
  *      Version: 0.01
10
  *    File Info: '$Id: metacatgetlog.html 3780 2008-04-02 23:28:31Z daigle $'
11
  * 
12
  * October Meeting SDSC, 2000
13
-->
14
<HTML>
15
<HEAD>
16
<TITLE>Metacat</TITLE>
17
<link rel="stylesheet" type="text/css" href="./default.css">
18
</HEAD> 
19
<BODY>
20
  <table width="100%">
21
    <tr>
22
      <td class="tablehead" colspan="2"><p class="label">Metacat
23
       getlog action</p></td>
24
       <td class="tablehead" colspan="2" align="right">
25
         <a href="./metacatread.html">Back</a> | <a href="./metacattour.html">Home</a> | 
26
         <a href="./saxparser.html">Next</a>
27
       </td>
28
    </tr>
29
  </table>
30
  <p>
31
	The Metacat servlet provides an 'action' for retrieving a log of the
32
        events that have occurred, including document insertions, updates,
33
        deletes, and reads.  This allows a simple reporting facility where
34
        event reports can be output in XML format.  The report can be subset to
35
        only include events from a particular IP address, user, event type,
36
        after a start date, or before an end date.
37
  </p>
38
  <p>
39
	The basic log can be viewed using the <code>getlog</code> servlet 
40
	action, as in the following URL:<br>
41
     	<code>http://some.metacat.host/context/metacat?action=getlog</code>
42
  </p>
43
  <p>
44
  	This will return an XML formatted log of all events since the log was
45
	initiated, which can be quite extensive.  To subset the report, provide
46
        parameters to restrict the set of matching events:
47
        <ul>
48
        <li>ipAddress -- restrict the report to this ipAddress (repeatable)</li>
49
        <li>principal -- restrict the report to this principal (repeatable)</li>
50
        <li>docid -- restrict the report to this docid (repeatable)</li>
51
        <li>event -- restrict the report to this event type (repeatable)
52
            <ul>
53
            <li><code>insert</code></li>
54
            <li><code>update</code></li>
55
            <li><code>delete</code></li>
56
            <li><code>read</code></li>
57
            </ul>
58
        </li>
59
        <li>start -- restrict the report to events after this date
60
            <ul>
61
            <li><code>YYYY-MM-DD+hh:mm:ss</code></li>
62
            </ul>
63
        </li>
64
        <li>end -- restrict the report to events before this date
65
            <ul>
66
            <li><code>YYYY-MM-DD+hh:mm:ss</code></li>
67
            </ul>
68
        </li>
69
        </ul>
70
  </p>
71
  <p>
72
	Some example queries follow.  To view only the 'read' events, use a url like:<br>
73
     	<code>http://some.metacat.host/context/metacat?action=getlog&event=read</code>
74
  </p>
75
  <p>
76
	To view only the events for a particular IP address, use a url like:<br>
77
     	<code>http://some.metacat.host/context/metacat?action=getlog&ipaddress=107.9.1.31</code>
78
  </p>
79
  <p>
80
	To view only the events for a given user, use a url like:<br>
81
     	<code>http://some.metacat.host/context/metacat?action=getlog&principal=uid=johndoe,o=NCEAS,dc=ecoinformatics,dc=org</code>
82
  </p>
83
  <p>
84
	To view only the events for a particular document, use a url like:<br>
85
     	<code>http://some.metacat.host/context/metacat?action=getlog&docid=knb.5.1</code>
86
  </p>
87
  <p>
88
	To view only the events after a given date, use a url like:<br>
89
     	<code>http://some.metacat.host/context/metacat?action=getlog&start=2004-09-15+12:00:00</code>
90
  </p>
91
  <p>
92
	To view only the events before a given date, use a url like:<br>
93
     	<code>http://some.metacat.host/context/metacat?action=getlog&end=2004-09-15+12:00:00</code>
94
  </p>
95
  <p>
96
	Query parameters can be combined, so to view the 'insert' events for September 2004 use a url like:<br>
97
     	<code>http://some.metacat.host/context/metacat?action=getlog&event=insert&start=2004-09-01+12:00:00&end=2004-09-30+23:59:59</code>
98
  </p>
99
  <p>
100
	The log is returned in XML format.  Here is an example log format:<br>
101
        <pre>
102
&lt;?xml version="1.0"?&gt;
103
&lt;log&gt;
104
&lt;logEntry&gt;&lt;entryid&gt;44&lt;/entryid&gt;&lt;ipAddress&gt;34.237.20.142&lt;/ipAddress&gt;&lt;principal&gt;uid=jones,o=NCEAS,dc=ecoinformatics,dc=org&lt;/principal&gt;&lt;docid&gt;esa.2.1&lt;/docid&gt;&lt;event&gt;insert&lt;/event&gt;&lt;dateLogged&gt;2004-09-08 19:08:18.16&lt;/dateLogged&gt;&lt;/logEntry&gt;
105
&lt;logEntry&gt;&lt;entryid&gt;47&lt;/entryid&gt;&lt;ipAddress&gt;34.237.20.142&lt;/ipAddress&gt;&lt;principal&gt;uid=jones,o=NCEAS,dc=ecoinformatics,dc=org&lt;/principal&gt;&lt;docid&gt;esa.3.1&lt;/docid&gt;&lt;event&gt;insert&lt;/event&gt;&lt;dateLogged&gt;2004-09-14 19:50:40.61&lt;/dateLogged&gt;&lt;/logEntry&gt;
106
&lt;/log&gt;
107

    
108
        </pre>
109
  </p>
110
  <br>
111
  <a href="./metacatread.html">Back</a> | <a href="./metacattour.html">Home</a> | 
112
  <a href="./saxparser.html">Next</a>
113

    
114
</BODY>
115
</HTML>
116

    
(33-33/61)