If necessary, you can create your own reports and export data in any format — CSV, JSON, or TabSeparated — without additional tools.
Data is stored in four main logs:
The command format is as follows:
clickhouse-client --database=qoestor --query="your SQL here"
By default, data is exported in TabSeparated format.
Example: The client requested a connection log with a specific host in CSV format.
clickhouse-client --database=qoestor --query="select * from fullflow prewhere flow_start_date = '2018-10-04' where (source_ipv4 = '10.64.66.100' or destination_ipv4 = '10.64.66.100') and host = 'google.com' ORDER BY flow_start_time limit 10 format CSV"
For detailed information on ClickHouse SQL, see https://clickhouse.com/docs/ru/sql-reference/statements/select.
Data export is performed using the fastor-report-cli script.
Example usage:
mkdir -p /tmp/reports_sql
mkdir -p /tmp/reports_results
cp /var/qoestor/backend/app_bash/export/reports_cli/top_hosts_ips.sql /tmp/reports_sql
In this example, the query for TOP IP hosts — top_hosts_ips.sql — is copied.
fastor-report-cli -r top_hosts_ips.sql -d /tmp/reports_results -w /tmp/reports_sql
where
-w /tmp/reports_sql — working directory containing your queries-r top_hosts_ips.sql — your query file-d /tmp/reports_results — directory where report files will be saved