Technical Tip: How to export Raw Event Logs from the command line interface
| Description | This article describes how to export raw event logs using the command line. |
| Scope | FortiSIEM. |
| Solution | The tool to be used to export the logs will depend on the storage type:
The Raw Event Logs will be exported in CSV format.
If using EventDB, use the 'phExportEvent' tool to export events.
Usage:
phExportEvent --src <SourceDir> --dest <DestinationDir> --starttime <startTime> --endtime <endTime>
The following are valid time limits:
--relstarttime <RelativeStartTime> --endtime <EndTime> --starttime <StartTime> --relendtime <RelativeEndTime> <time> : "YYYY-MM-DD hh:mm:ss[+-]TZ" (notice the quotation marks) <relativeTime> : Num(d|h|m) d/h/m means days/hours/minutes
Example:
phExportEvent --src /data/eventdb --dest /home/admin --starttime "2010-10-18 11:00:00-7" --endtime "2010-10-18 12:00:00-7" --org Super --org customer111
(The -7 timezone is Pacific Daylight-savings Time (PDT) or GMT-7).
If using ClickHouse, use the 'phClickHouseCSVExport' tool to export events:
phClickHouseCSVExport --starttime [Start Time] --endtime [End Time] --outfile [Output file] --deviceip [Reporting IP] --devicename [Reporting Device Name] --limit [specify the number of records to return, default - no limit] --debug [Dump SQL statement generated for this report]
A valid time limit is in the following format:
The supported timezone is GMT.
Example:
If using Elasticsearch, use the 'phExportESEvent' tool: Usage:
phExportESEvent <ESUrl> <ESPort> <ESDeploymentType> "<ESUser>" "<ESPassword>" <ESIndexName> <ReportingDevIp> <destDir> <splitThreads> <LogLevel>
Examples:
Native Elasticsearch Deployment Example:
AWS Elasticsearch Service Deployment Example:
Elasticsearch Cloud Deployment Example:
phExportESEvent https://cpaagg33-d11e01.es.us-central1.gcp.cloud.es.io 9243 3 "elastic" "password" fortisiem-event-2021.10.01-1-000001 "" /archive/ 10 INFO
Note:
Related document: |
