Filter Expressions
The filter expression language allows for data set filtering using a simplified expression language. The language itself supports boolean logic (and
, or
, ()
) and equivalences (>=
, <=
, !=
, ==
). String values are wrapped in quotes (""
, ''
) and columns values can be accessed using the column name.
The filter expression language is used with the filter
command, tag
command, and the globally available --filter
flag.
Examples
Filtering for a specific status code
... || filter "status.code == 200"
The above filter expression will compare the values contained in the status.code
column to the value 200
.
... || filter 'status.code == "ok"'
The above filter expression will compare the values contained in the status.code
column to the value ok
.
... || filter "status.code == code"
The above filter expression will compare the values contained in the status.code
column to the values contained in another column named code
.
Boolean filters
... || filter "((status.code == 303) or (status.code < 300)) and response.data == 'ok'"
The above filter expression uses parentheses to group logical boolean operations together. This filter willinclude rows where the response.data
value is ok
and the status.code
is either 303
or less than 300
.