OpenSearch dashboard is a solution allowing data visualization on top of an existing OpenSearch cluster.
It can be used to create interesting visualizations when used on top of Apache James OpenSearch indexes.
docker-compose.yml file to your needs (IP address & credentials)docker compose uphttp://127.0.0.1:5601 with the credential documented in the docker-compose.yml fileDashboard Management > Index pattern import the mailbox_v2 (using date as a date field) and quota_ratio_v1Dashboard Management > Saved objects import james-dashboard.ndjsonSome of the above visualizations relies on scripted fields.
In order to create them navigate the following menus:
Dashboard management Index pattern mailbox_v2 scripted field
Then create the following scripted fields:
language: painless
type: number
format: numer
name: recipientCount
Script:
int count = 0;
for (nested in params._source.to) {
count += 1;
}
return count;
and
> Dashboard management
> Index pattern
> mailbox_v2
> scripted field
language: painless
type: number
format: numer
name: deliveryTime
Script:
if (doc.containsKey('saveDate') && doc.containsKey('sentDate')) {
return (doc['saveDate'].value.getMillis() - doc['sentDate'].value.getMillis()) / 1000;
} else {
return 0;
}