In certain cases, administrators may need to export detailed records of Threats and Anomalies from Splunk UBA for offline analysis, correlation with other systems, or archival purposes. While logs may already be forwarded to an external system such as Splunk Enterprise Security, extracting the data directly from UBA’s PostgreSQL database allows for full access to all stored details, including file names, suspicious extensions, email recipients, and other relevant fields.

The requirement was to identify whether Splunk UBA offers a way to export detailed Threats and Anomalies data in a structured CSV format. Since these records reside in UBA’s PostgreSQL database (caspidadb), direct SQL extraction was determined to be the most efficient approach. Testing confirmed that executing the export commands from the management node as the caspida user, or on node 2 in a 20-node cluster, successfully generated CSV files for both anomalies and threats.
To export the Threats and Anomalies data from Splunk UBA, follow the steps below:
Log in to the Postgres running node as the caspida user (In 20 nodes cluster, execute the command on the node 2).
Run the following commands:
for i in anomalies threats do echo "Exporting table: ${i}" psql -d caspidadb -A -F "," -t -o ${i}.csv -c "SELECT * FROM public.${i}" done
The above commands will create two CSV files in the current directory:
anomalies.csv – containing all anomaly records.
threats.csv – containing all threat records.
anomalies.csv will contains the associated anomaly details like anomaly Ids, models involved , user and its related IPs.
Splunk Docs
| Revision | Publish Date | Comments |
|---|---|---|
1.0 |
01-Oct-2026
|
Initial Release |