SEARCHLOG { attributes } -- list editors of a topic

  • A %SEARCHLOG% without parameters shows a list of requests made to foswiki
  • The following standard attributes are recognized
    Name Description Default
    "query" query search but with a very restriced set of fields (time, user, webtopic, extra, addr), like d2n('20 Oct 2010') < time AND time < d2n('25 Oct 2010') AND action = 'save' true
    from A time string like '10 Oct 2010' 7days ago
    to A time string like '10 Oct 2010' time now
    header, footer, separator header and footer and separator as per FormattedSearch no header or footer and separator defaults to $n
    format Format of revision information, see supported formatting tokens below | $time | $action | $webtopic Revision $rev | $user | $extra |
    limit only show a limited set of matching results, to avoid thrashing the web server (you can tune this for your circumstances) 25
    reverse reverse the time order of the output set false
    showRepRev if "on", save repRev events (when a new revision is not created because the same user edits the topic again withint the timeout period off
  • Supported formatting tokens
    Token: Unit: Example
    $index a counter that increases for each item matching the query  
    $webtopic web.topic affected in the log item  
    $web web affected in the log item  
    $topic topic affected in the log item  
    $rev revision number accessed/modified in the log item (note: this does a lookup of the topic revision info, so increases the load on the server)  
    $user Login username of revision jsmith
    $action save, view, edit, attach etc  
    $extra any extra information logged by foswiki  
    $time action time 23:24:25
    $min, $sec, etc. Same date format qualifiers as GMTIME{"format"}  
    $from, $to, $last and $from($time specifiers), $to($time specifiers), $last($time specifiers) (header and footer only) format the from, to and last time found in seconds since the epoch - useful for making a simple pager interface  

EXAMPLE: show all save's from 10 Oct 2010, with a simple pager in the header&footer

%SEARCHLOG{
 "d2n('20 Oct 2010') < time AND time < d2n('25 Oct 2010') AND action = '%URLPARAM{"action" default="save"}%'"
   from="%URLPARAM{"from" default="10 Oct 2010"}%"
   limit="%URLPARAM{"limit" default="25"}%"
   header="| $index entries |||| $from to $last [[%SCRIPTURL{view}%/%BASEWEB%/%BASETOPIC%?from=$epochlast][more..]]| $n| *Date* | Action | Topic | User | Extra |"
   footer="| $index entries |||| $from to $last [[%SCRIPTURL{view}%/%BASEWEB%/%BASETOPIC%?from=$epochlast][more..]]|"
}%

EXAMPLE: show all save's by a user (note that you need to use the user's loginname

%SEARCHLOG{
 "d2n('20 Oct 2010') < time AND user='%USERNAME%' AND action = '%URLPARAM{"action" default="save"}%'"
   from="%URLPARAM{"from" default="10 Oct 2010"}%"
   limit="%URLPARAM{"limit" default="25"}%"
   header="| $index entries |||| $from to $last [[%SCRIPTURL{view}%/%BASEWEB%/%BASETOPIC%?from=$epochlast][more..]]| $n| *Date* | Action | Topic | User | Extra |"
   footer="| $index entries |||| $from to $last [[%SCRIPTURL{view}%/%BASEWEB%/%BASETOPIC%?from=$epochlast][more..]]|"
}%

Topic revision: r1 - 14 Dec 2010, SvenDowideit - This page was cached on 09 Jan 2018 - 18:05.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License