summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/admin/journald/usage.rst20
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/admin/journald/usage.rst b/doc/admin/journald/usage.rst
index 535eeec..d9e00b8 100644
--- a/doc/admin/journald/usage.rst
+++ b/doc/admin/journald/usage.rst
@@ -24,6 +24,26 @@ instances in classic syslog-like format:
see the :ref:`inst-enum-limit` remark.
+Using WQL query for simple filtering
+------------------------------------
+
+From its nature LMIShell can only do simple filtering by matching exact property
+values. However there's a posibility of constructing custom CQL or WQL queries
+bringing more flexibility in specific test conditions. The result from the query
+method call is a list of instances, similar to calling ``".associators()"`` or
+``".instances()"``.
+
+The following example uses WQL query to get a list of messages with syslog
+severity 3 (error) or higher:
+
+::
+
+ #!/usr/bin/lmishell
+ c = connect("localhost", "pegasus", "test")
+ for rec in c.root.cimv2.wql("SELECT * FROM LMI_JournalLogRecord WHERE SyslogSeverity <= 3"):
+ print "[severity %d] %s" % (rec.SyslogSeverity, rec.DataFormat)
+
+
Iterating through the log
-------------------------