If you use mnesia for mod_roster, then it is possible for some arguments (SUBS, ASKS, USERS and CONTACTS). The character to separate several elements is :. With SQL storage it isn't possible... but in that case you probably can use some SQL query anyway.
For example, to get users that have as contacts user1 or user2:
$ ejabberdctl process_rosteritems list any any any user1@localhost:user2@localhost
user3@localhost user1@localhost
user1@localhost user2@localhost
user2@localhost user1@localhost
As mentioned in the command documentation:
$ ejabberdctl help process_rosteritems
Command Name: process_rosteritems
Arguments: action::string
subs::string
asks::string
users::string
contacts::string
Returns: response::[ pairs::{ user::string,
contact::string } ]
Tags: roster
Description: List/delete rosteritems that match filter
Explanation of each argument:
- action: what to do with each rosteritem that matches all the filtering options
- subs: subscription type
- asks: pending subscription
- users: the JIDs of the local user
- contacts: the JIDs of the contact in the roster
*** Mnesia:
Allowed values in the arguments:
ACTION = list | delete
SUBS = SUB[:SUB]* | any
SUB = none | from | to | both
ASKS = ASK[:ASK]* | any
ASK = none | out | in
USERS = JID[:JID]* | any
CONTACTS = JID[:JID]* | any
JID = characters valid in a JID, and can use the globs: *, ?, ! and [...]
This example will list roster items with subscription 'none', 'from' or 'to' that have any ask property, of local users
which JID is in the virtual host 'example.org' and that the contact JID is either a bare server name (without user part)
or that has a user part and the server part contains the word 'icq':
list none:from:to any *@example.org *:*@*icq*
*** SQL:
Allowed values in the arguments:
ACTION = list | delete
SUBS = any | none | from | to | both
ASKS = any | none | out | in
USERS = JID
CONTACTS = JID
JID = characters valid in a JID, and can use the globs: _ and %
This example will list roster items with subscription 'to' that have any ask property, of local users which JID is in the
virtual host 'example.org' and that the contact JID's server part contains the word 'icq':
list to any %@example.org %@%icq%