Write to Local File
The Write to Local File output can be used to write data from event records to a local file. You can find this output in the Web and Messaging output option.
Example
The following is an example use case for the output:
A manufacturing company processes IoT sensor data from its production line and needs to store a local copy of these events for troubleshooting. They configure the Write to Local File output with an absolute path, C:\Velocity\output\IoTLogs, a file name prefix (sensor_events), and a .csv extension. They chose the size rollover method with a 5 MB threshold to prevent oversized files and ensure manageable logs. The output format is set to delimited with a comma as the field delimiter and a newline character as the message separator, making the data easy to read and compatible with analysis tools like Microsoft Excel.
Usage notes
Keep the following in mind when working with the output:
It is recommended that you use absolute paths as best practice—for example,
C:\Velocity\output.If you restart the output, ArcGIS Velocity creates a new file in the folder path.
The File rollover size (KB) parameter can be increased depending on the rate and volume of processed event records. The default, 1024 bytes, forces the operating system to close and open new files frequently when processing higher volumes of data through an analytic.
The Message separator and Field delimiter parameters are required to adapt processed event records as delimited text.
The File extension parameter specifies the type of file. The extension must start with a dot so that a file name can be prepended. Velocity supports
.txt,.csv, and.jsonas file formats.The output file naming conventions vary based on the rollover method chosen. For example, if the rollover method is size,
yyyy-MM-dd_hh-MM-ss.txtis appended to the file base name. If the rollover method is time,yyyy-MM-dd_hh.txtis appended to the file base name.To write files to a local directory, the user account running Velocity must have read, write, and modify permissions on the target directory. Permission to access, read, and/or delete a specified file is controlled by the operating system.
Parameters
The following are the parameters for the output:
|
Parameter |
Description |
Data type |
|---|---|---|
|
File directory (Required) |
The directory of the local file—for example, |
String |
|
Filename prefix (Required) |
The descriptive name of the output file Velocity creates and writes to. The default is output. |
String |
|
File extension (Required) |
The file extension used when creating a file. The file extension must start with a dot, for example, |
String |
|
File rollover method |
The method used to decide when Velocity stops writing to a current file and begins writing to a new file. The default is the By Time option. The file rollover method options are as follows:
|
String |
|
File rollover size (Conditional) |
Specifies the maximum size, in kilobytes (KB), a file can reach before Velocity stops writing it. Once the maximum file size has been reached, Velocity creates a new file to start writing. The default is 1 kilobyte (KB) or 1024 bytes. This parameter is shown when the File Rollover Method parameter is set to the By Size option and is hidden when it is set to the By Time option. |
Integer |
|
File rollover frequency (Conditional) |
Specifies the frequency with which Velocity stops writing to the current file and instead creates a new file to start writing to. The default is the Hourly option. The age-based rollover options are as follows:
This parameter is shown when the File Rollover Method parameter is set to the By Time option and is hidden when it is set to the By Size option. |
String |
|
Output data format |
The format of the output data. The options are Delimited text, JSON, GeoJSON, and EsriJSON. The default is Delimited text. |
Output data format type |
|
Field delimiter |
Specifies a character or delimiter to separate field values in output messages. The default is the comma (,). |
Character or a delimiter |
|
Message separator |
The literal character used by files to separate messages. The default is a new line character \n. |
Character |