intelmq.bots.parsers.zoneh package

Submodules

intelmq.bots.parsers.zoneh.parser module

ZoneH CSV defacement report parser

intelmq.bots.parsers.zoneh.parser.BOT

alias of ZoneHParserBot

class intelmq.bots.parsers.zoneh.parser.ZoneHParserBot(*args, **kwargs)

Bases: ParserBot

Parse the ZoneH CSV feed

parse(report: Report)

A basic CSV Dictionary parser. The resulting lines are dictionaries with the column names as keys.

parse_line(row, report)

A generator which can yield one or more messages contained in line.

Report has the full message, thus you can access some metadata. Override for your use.

recover_line(line: str | None = None) str

Reverse of “parse” for single lines.

Recovers a fully functional report with only the problematic line by concatenating all strings in “self.tempdata” with “line” with LF newlines. Works fine for most text files.

Parameters:

line (Optional[str], optional) – The currently process line which should be transferred into it’s original appearance. As fallback, “self._current_line” is used if available (depending on self.parse). The default is None.

Raises:

ValueError – If neither the parameter “line” nor the member “self._current_line” is available.

Returns:

str

The reconstructed raw data.

Module contents