Filters

Describes the use of filters with MapR CLI commands.

Some MapR CLI commands use filters, which let you specify large numbers of nodes or volumes by matching specified values in specified fields rather than by typing each name explicitly.

Filters use the following format:

[<field><operator>"<value>"]<and>[<field><operator>"<value>"] ...

field

Field on which to filter. The field depends on the command with which the filter is used.

operator

An operator for that field:

  • == - Exact match
  • != - Does not match
  • > - Greater than
  • < - Less than
  • >= - Greater than or equal to
  • <= - Less than or equal to

value

Value on which to filter. Wildcards (using *) are allowed for operators == and !=. There is a special value all that matches all values.

You can use the wildcard (*) for partial matches. For example, you can display all volumes whose owner is root and whose name begins with test as follows:

maprcli volume list -filter [n=="test*"]and[on=="root"]
NOTE maprcli commands and REST APIs do not support OR conditions.

If you are using the <, > , <=, or >= symbols in the filter expression, ensure that you enclose the expression in single or double quotes. For example, -filter '[quota>=1234]' or -filter "[quota>=1234]"