How to Filter Room History

Summary

The getRoomHistoryList action has some powerful filtering capabilities. This page discusses the options available.

Regex Filtering

Many CLI list actions provide support for the regex parameter that can subset lists based on entry content. In the case of room history, this can be used to match message content for inclusion in the resulting list. For an example on this, see How to Monitor Language in Public Chat Rooms (Intermediate).

Date Filtering

By default, the getRoomHistoryList action returns the most recent 75 entries. This number of entries returned can be changed by using the limit parameter (and the the regex support mentioned above). To have more specific control over what is listed, one or both of the date parameters can be used: 

  1. startDate - Earliest date to get history data. Default is recent to get the most recent 75 entries.
  2. endDate - Latest date for history entries. Default to now (most recent)

The dates should be specified to match the dateFormat parameter. If not provided, the local default format will be tried. The CLI also tries (release 4.3 and higher) some standard default formats like: yyyy-MM-dd HH:mm:ss

Special Values

The date fields support some special values to make range selection easier: