zabgrab.services.naming¶
Output file names.
- zabgrab.services.naming.MAX_HOSTS¶
The most host names in an automatic name before the rest are counted.
- Type:
Functions
|
Get the output format implied by a file name's extension, if any. |
|
Build a file name (without extension) from |
|
Get |
- zabgrab.services.naming.format_for(path)[source]¶
Get the output format implied by a file name’s extension, if any.
- zabgrab.services.naming.output_name(pattern, *, hosts, template, custom, start, end, server, resolution)[source]¶
Build a file name (without extension) from
output_pattern.Unsafe characters become
-, and the name is kept toMAX_LENGTHcharacters, showing fewer hosts if needed.- Parameters:
pattern (str) – The pattern. Placeholders:
{hosts}(matched hosts, sorted, joined with+; more than three are shortened),{template}(the template’s name, plus__customif the command line added or changed data),{from}/{to}(UTC, e.g.20261014T101500Z),{server}and{resolution}.hosts (sequence of str) – The hosts of the fetched items.
template (str or None) – The template used, if any.
custom (bool) – Whether the command line added or changed data.
start (datetime) – The fetched time range.
end (datetime) – The fetched time range.
server (str) – A short name for the server.
resolution (str) –
rawor1h.
- Returns:
str – The name.
- Raises:
ZabgrabError – If the pattern is invalid (e.g. an unknown placeholder).
- Return type: