zipfile
Retrieves text from a ZIP archive.
Command properties
| Property | Description |
|---|---|
| Command type | Driver query |
| Required permission | Local file read access |
| License usage | Counted |
| Parallel execution | Not supported |
| Distributed execution | Not supported |
Syntax
zipfile [offset=INT] [limit=INT] PATH ENTRY
Options
offset=INT- Number of records to skip.
limit=INT- Maximum number of records to retrieve.
Target
PATH- ZIP file path.
ENTRY- Path of the entry (file) within the ZIP archive.
Output fields
| Field | Type | Description |
|---|---|---|
| line | string | Original line read from the text file |
| _file | string | ZIP file path |
| _entry | string | ZIP entry path |
| _time | timestamp | Timestamp (current time) |
Error codes
Parsing errors
| Error code | Message | Description |
|---|---|---|
| 14002 | - | No file path or entry path was specified |
| 14000 | - | The file does not exist or cannot be read |
| 14001 | - | The parent directory does not exist or cannot be read |
| 14003 | - | Access to the file was denied |
Description
The zipfile command retrieves data from text files compressed in a ZIP archive. It returns each line of the specified entry as a record with the content stored in the line field. When a wildcard (*) is used in PATH, multiple ZIP files are processed in order.
Examples
-
Retrieve text from a file inside a ZIP archive
zipfile /opt/logpresso/data/logs.zip access.logRetrieves the
access.logentry insidelogs.zipline by line. -
Retrieve with a record count limit
zipfile limit=100 /opt/logpresso/data/logs.zip error.logRetrieves up to 100 records from the
error.logentry.